AppleWin/source/frontends/common2/timer.h
Andrea Odetti 169188b2b4 Improve stat logging.
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2020-11-13 20:12:57 +00:00

24 lines
393 B
C++

#include <chrono>
#include <iosfwd>
class Timer
{
public:
Timer();
void tic();
void toc();
double getTimeInSeconds() const;
friend std::ostream& operator<<(std::ostream& os, const Timer & timer);
private:
std::chrono::time_point<std::chrono::steady_clock> myT0;
double mySum;
double mySum2;
int myN;
};
std::ostream& operator<<(std::ostream& os, const Timer & timer);