AppleWin/source/frontends/common2/timer.h
Andrea Odetti 3b917e93be common2: add namespace and reformat everything with space over tabs.
This makes it "possible" to use other editors (than emacs).

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
2021-02-25 16:04:50 +00:00

29 lines
447 B
C++

#include <chrono>
#include <iosfwd>
namespace common2
{
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);
}