1 #ifndef STOPWATCH_CLASS
2 #define STOPWATCH_CLASS
58 enum stopwatch_kinds { UNSTARTED, RUNNING, STOPPED };
59 stopwatch_kinds _status;
60 time_stamp *_start_time;
61 time_stamp *_stop_time;
67 int compute_diff(
const time_stamp &t1,
const time_stamp &t2);
79 #define TIME_CHECK_BEGIN \
82 #define TIME_CHECK_END(logger, who, msec_limit, what, filter) { \
84 if (t.milliseconds() > msec_limit) { \
85 (logger).log( a_sprintf("TIME_CHECK: %s: %d ms wait for %s.", \
86 (who), t.milliseconds(), (what)), filter); \
A class for measuring event durations in real time.
stopwatch & operator=(const stopwatch &to_copy)
int milliseconds()
Returns the elapsed number of milliseconds on the stopwatch, overall.
void halt()
Stops the timing.
void reset()
Stops the stopwatch and clears it to zero time elapsed.
void stop()
a synonym for halt().
int elapsed()
a synonym for milliseconds().
void start()
Begins the timing.