21 #ifndef stopwatch_hh__ 22 #define stopwatch_hh__ 109 typedef std::chrono::steady_clock
clock;
long seconds() const
Number of seconds elapsed.
Definition: Stopwatch.cc:60
long elapsed_
Definition: Stopwatch.hh:130
std::ostream & operator<<(std::ostream &, const Stopwatch &)
Print human-readable representation of the time elapsed.
Definition: Stopwatch.cc:72
long useconds() const
Number of micro-seconds elapsed (needs to be added to 'seconds').
Definition: Stopwatch.cc:66
The Stopwach class provides a simple interace to allow timing function calls etc...
Definition: Stopwatch.hh:105
void stop()
Stop timing.
Definition: Stopwatch.cc:41
std::chrono::steady_clock clock
Definition: Stopwatch.hh:109
clock::time_point start_
Definition: Stopwatch.hh:129
static const long s_to_us
Definition: Stopwatch.hh:133
bool stopped_
Definition: Stopwatch.hh:131
Stopwatch()
Definition: Stopwatch.cc:24
friend std::ostream & operator<<(std::ostream &, const Stopwatch &)
Print human-readable representation of the time elapsed.
Definition: Stopwatch.cc:72
void start()
Continue timing (does not reset).
Definition: Stopwatch.cc:35
void checkpoint_() const
Definition: Stopwatch.cc:52
bool stopped() const
Is the stopwatch currently timing?
Definition: Stopwatch.cc:47
void reset()
Reset to no-time-elapsed.
Definition: Stopwatch.cc:29