SheafSystem
0.0.0.0
|
A clock for timing intervals. More...
#include <stop_watch.h>
Public Types | |
enum | time_unit { CPU_TIME, MILLISECONDS, SECONDS } |
The unit of time to return. More... | |
Public Member Functions | |
virtual bool | invariant () const |
Class invariant. More... | |
stop_watch () | |
Default constructor. More... | |
virtual | ~stop_watch () |
Destructor. More... | |
void | start () |
Marks the start of an interval. More... | |
void | stop () |
Marks the end of an interval. More... | |
double | time (time_unit xunit=SECONDS) const |
The length of the current interval. More... | |
double | cumulative_time () const |
The accumulated time in seconds between start()'s and stop()'s since the last reset(). More... | |
void | mark_lap () |
Marks the end of the current lap. More... | |
double | lap_time (int i) const |
The length in seconds of the xi-th lap. More... | |
size_t | lap_ct () const |
The number of laps that have be marked. More... | |
void | reset () |
Clears the lap times and sets lap_ct() to 0. More... | |
A clock for timing intervals.
Definition at line 45 of file stop_watch.h.
The unit of time to return.
Definition at line 82 of file stop_watch.h.
sheaf::stop_watch::stop_watch | ( | ) |
Default constructor.
Definition at line 49 of file stop_watch.cc.
References invariant(), reset(), and ~stop_watch().
Referenced by invariant().
|
virtual |
Destructor.
Definition at line 68 of file stop_watch.cc.
References start().
Referenced by stop_watch().
double sheaf::stop_watch::cumulative_time | ( | ) | const |
The accumulated time in seconds between start()'s and stop()'s since the last reset().
Definition at line 157 of file stop_watch.cc.
References mark_lap().
Referenced by sheaf::operator<<(), and time().
|
virtual |
Class invariant.
Definition at line 33 of file stop_watch.cc.
References stop_watch().
Referenced by stop_watch().
size_t sheaf::stop_watch::lap_ct | ( | ) | const |
The number of laps that have be marked.
Definition at line 221 of file stop_watch.cc.
References reset().
Referenced by lap_time(), sheaf::operator<<(), and reset().
double sheaf::stop_watch::lap_time | ( | int | i | ) | const |
The length in seconds of the xi-th lap.
Definition at line 197 of file stop_watch.cc.
References lap_ct().
Referenced by mark_lap(), and sheaf::operator<<().
void sheaf::stop_watch::mark_lap | ( | ) |
Marks the end of the current lap.
Definition at line 176 of file stop_watch.cc.
References lap_time(), stop(), and time().
Referenced by cumulative_time().
void sheaf::stop_watch::reset | ( | ) |
Clears the lap times and sets lap_ct() to 0.
Definition at line 242 of file stop_watch.cc.
References lap_ct(), and time().
Referenced by lap_ct(), and stop_watch().
void sheaf::stop_watch::start | ( | ) |
Marks the start of an interval.
Definition at line 85 of file stop_watch.cc.
References stop().
Referenced by ~stop_watch().
void sheaf::stop_watch::stop | ( | ) |
Marks the end of an interval.
Definition at line 102 of file stop_watch.cc.
References time().
Referenced by mark_lap(), and start().
double sheaf::stop_watch::time | ( | time_unit | xunit = SECONDS | ) | const |
The length of the current interval.
Definition at line 121 of file stop_watch.cc.
References cumulative_time().
Referenced by mark_lap(), reset(), and stop().