#include <CPrecisionClock.h>
Public Member Functions | |
cPrecisionClock () | |
Constructor of cPrecisionClock. | |
~cPrecisionClock () | |
Destructor of cPrecisionClock. | |
void | reset () |
Reset clock to zero. | |
double | start (bool a_resetClock=false) |
Start counting time; optionally reset the clock to zero. | |
double | stop () |
Stop counting time; return the elapsed time. | |
bool | on () |
Return true if timer is currently on, else return false. | |
double | getCurrentTimeSeconds () |
Read the current clock time (seconds) (the time that has elapsed since the last call to "start"). | |
void | setTimeoutPeriodSeconds (double a_timeoutPeriod) |
Set the period before a "timeout" occurs (you need to poll for this). | |
double | getTimeoutPeriodSeconds () |
Read the programmed timeout period. | |
bool | timeoutOccurred () |
Returns true if a timeout has occurred. | |
bool | highResolution () |
Returns true if high resolution timers are available on this computer. | |
double | getCPUTimeSeconds () |
If all you want is something that tells you the time, this is your function... | |
double | getCPUTime () |
For backwards-compatibility... | |
double | getCPUtime () |
For backwards-compatibility... |
cPrecisionClock::cPrecisionClock | ( | ) |
Constructor of cPrecisionClock.
Constructor of cPrecisionClock. Clock is initialized to zero.
long cPrecisionClock::getCPUtime | ( | ) | [inline] |
For backwards-compatibility...
If all you want is something that tells you the time, this is your function...
double cPrecisionClock::getCurrentTimeSeconds | ( | ) |
Read the current clock time (seconds) (the time that has elapsed since the last call to "start").
Read the current time of timer. Result is returned in seconds.
void cPrecisionClock::reset | ( | void | ) |
Reset clock to zero.
Reset the clock to zero.
void cPrecisionClock::setTimeoutPeriodSeconds | ( | double | a_timeoutPeriod | ) |
Set the period before a "timeout" occurs (you need to poll for this).
Set the period in microseconds before timeout occurs. Do not forget to set the timer on by calling method start()
a_timeoutPeriod | Timeout period in seconds. |
double cPrecisionClock::start | ( | bool | a_resetClock = false |
) |
Start counting time; optionally reset the clock to zero.
Start the clock from its current time value. To read the latest time from the clock, use method getCurrentTime.
a_resetClock | Should we start counting from zero? |
double cPrecisionClock::stop | ( | ) |
Stop counting time; return the elapsed time.
Stop the timer. To resume counting call start().
bool cPrecisionClock::timeoutOccurred | ( | ) |
Returns true if a timeout has occurred.
Check if timer has expired its timeout period. if so return true.