|
enum | TimerModes { NORMAL_MODE =0,
COUNTDOWN_MODE
} |
|
|
unsigned long | startTime |
|
unsigned long | countDownTime |
|
unsigned int | timerMode |
|
bool | timerRunning |
|
Definition at line 42 of file Timer.h.
Default constructor.
Definition at line 47 of file Timer.h.
Default destructor.
Definition at line 52 of file Timer.h.
signed long GRT::Timer::getMilliSeconds |
( |
| ) |
const |
|
inline |
Gets the current time in milliseconds. If the timer is in NORMAL_MODE then this value will be the time since the timer was started. If the timer was in COUNTDOWN_MODE then this value will be the countdown time, minus the time since the timer started.
- Returns
- returns the current time elapsed in milliseconds (1000 milliseconds == 1 second) or 0 if the timer is not running
Definition at line 100 of file Timer.h.
double GRT::Timer::getSeconds |
( |
| ) |
const |
|
inline |
Gets the current time in seconds. If the timer is in NORMAL_MODE then this value will be the time since the timer was started. If the timer was in COUNTDOWN_MODE then this value will be the countdown time, minus the time since the timer started. Unlike the getMilliSeconds() function, in which 1.0 represents 1 millisecond; this function represents 1.0 as 1 second (so 0.5 is 500 milliseconds).
- Returns
- returns the current time elapsed in seconds or 0 if the timer is not running
Definition at line 128 of file Timer.h.
static unsigned long GRT::Timer::getSystemTime |
( |
| ) |
|
|
inlinestatic |
Gets if the current system time.
- Returns
- returns the current system time.
Definition at line 165 of file Timer.h.
bool GRT::Timer::getTimerReached |
( |
| ) |
const |
|
inline |
Gets if the countdown time has been reached.
- Returns
- returns true if the countdown time has been reached, false otherwise
Definition at line 145 of file Timer.h.
bool GRT::Timer::running |
( |
| ) |
const |
|
inline |
Gets if the timer is running.
- Returns
- returns true if the timer is running, false otherwise
Definition at line 138 of file Timer.h.
bool GRT::Timer::start |
( |
| ) |
|
|
inline |
Starts the timer. This starts the timer in NORMAL_MODE, in this mode the timer will run forever.
- Returns
- returns true if the timer was started successfully, false otherwise
Definition at line 59 of file Timer.h.
bool GRT::Timer::start |
( |
unsigned long |
countDownTime | ) |
|
|
inline |
Starts the timer. This starts the timer in COUNTDOWN_MODE, in this mode the timer will start at the specified countdown time and count down until it reaches zero. At zero, the timer will set its state to timerRunning = false, however the timer will continue to countdown resulting in a negative query time.
- Parameters
-
unsigned | long countDownTime: sets the countdown time, this should be in milliseconds (i.e. start(5000) would start the timer with a countdown time of 5 seconds) |
- Returns
- returns true if the timer was started successfully, false otherwise
Definition at line 73 of file Timer.h.
bool GRT::Timer::stop |
( |
| ) |
|
|
inline |
Stops the timer.
- Returns
- returns true if the timer was stopped successfully, false otherwise
Definition at line 89 of file Timer.h.
bool GRT::Timer::timerReached |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file:
- /Users/ngillian/Documents/dev/libs/grt/GRT/Util/Timer.h