Timer Class Reference
To handle elapsed time counting. More...
Public Member Functions | |
Timer () | |
Default constructor. | |
~Timer () | |
Destructor. | |
bool | Started () const |
Say if time counter has started. More... | |
void | Start () |
Start time counting. More... | |
void | Stop () |
Stop time counting. More... | |
void | Resume () |
Resume counting. | |
void | Clear () |
Clear time value (Set to zero) | |
double | get () const |
Return elapsed time (in seconds) | |
real_t | getTime () const |
Return elapsed time (in seconds) More... | |
Detailed Description
To handle elapsed time counting.
This class is to be used when testing program performances. A normal usage of the class is, once an instance is constructed, to use alternatively, Start, Stop and Resume. Elapsed time can be obtained once the member function Stop is called.
Member Function Documentation
bool Started | ( | ) | const |
Say if time counter has started.
Return true if time has started, false if not
void Start | ( | ) |
Start time counting.
This member function is to be used at first or if the user wants to clear time counting
void Stop | ( | ) |
Stop time counting.
This function interrupts time counting. This one can be resumed by the function Resume
real_t getTime | ( | ) | const |
Return elapsed time (in seconds)
Identical to get