22 using namespace basis;
26 stopwatch::stopwatch()
49 if (
this == &to_copy)
return *
this;
50 *_start_time = *to_copy._start_time;
51 *_stop_time = *to_copy._stop_time;
52 _status = to_copy._status;
53 _total_so_far = to_copy._total_so_far;
63 if (_status == RUNNING)
return;
73 if (_status == STOPPED)
return;
74 else if (_status == UNSTARTED)
return;
77 _total_so_far += compute_diff(*_start_time, *_stop_time);
82 int stopwatch::common_measure()
87 case UNSTARTED:
break;
95 to_return = _total_so_far;
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 start()
Begins the timing.
Represents a point in time relative to the operating system startup time.
time_representation value() const
returns the time_stamp in terms of the lower level type.
Constants and objects used throughout HOOPLE.
The guards collection helps in testing preconditions and reporting errors.
void WHACK(contents *&ptr)
deletion with clearing of the pointer.