|
enum | TimerMode { NORMAL_MODE =0,
COUNTDOWN_MODE
} |
|
enum | TimerState { NOT_RUNNING =0,
RUNNING,
COUNTDOWN_STATE,
PREP_STATE
} |
|
|
unsigned long | startTime |
|
unsigned long | countDownTime |
|
unsigned long | prepTime |
|
bool | timerRunning |
|
TimerMode | timerMode |
|
TimerState | timerState |
|
Definition at line 43 of file Timer.h.
Default constructor.
Definition at line 48 of file Timer.h.
Default destructor.
Definition at line 57 of file Timer.h.
signed long Timer::getMilliSeconds |
( |
| ) |
|
|
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 117 of file Timer.h.
Float Timer::getSeconds |
( |
| ) |
|
|
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 153 of file Timer.h.
static unsigned long Timer::getSystemTime |
( |
| ) |
|
|
inlinestatic |
Gets if the current system time.
- Returns
- returns the current system time.
Definition at line 211 of file Timer.h.
bool Timer::getTimerReached |
( |
| ) |
|
|
inline |
Gets if the countdown time has been reached.
- Returns
- returns true if the countdown time has been reached, false otherwise
Definition at line 183 of file Timer.h.
bool Timer::getTimerRunning |
( |
| ) |
|
|
inline |
Gets if the timer is running.
- Returns
- returns true if the timer is running, false otherwise
Definition at line 170 of file Timer.h.
Gets if the timer is running.
- Returns
- returns true if the timer is running, false otherwise
Definition at line 163 of file Timer.h.
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 64 of file Timer.h.
bool Timer::start |
( |
unsigned long |
countDownTime, |
|
|
unsigned long |
prepTime = 0 |
|
) |
| |
|
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. The second option controls the preperation time, this is useful if you are recording a gesture and want to have a short pause after triggering the recording before data is actually recorded/tagged. If the prepTime parameter is larger than zero, then the timer will enter the PREP_STATE for the specified prepTime before entering the COUNTDOWN_STATE.
- Parameters
-
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 81 of file Timer.h.
Stops the timer.
- Returns
- returns true if the timer was stopped successfully, false otherwise
Definition at line 105 of file Timer.h.
bool Timer::timerReached |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: