Action
Queries the current state of a timer.
Syntax
state = TimerState (hTimer)
Variable
|
Description
|
state
|
The state of the timer: TS_STARTED, TS_STOPPED, or TS_PAUSED.
TIMERSTATE.
|
hTimer
|
A handle to the timer to query. HTIMER.
|
Notes
TimerState is useful when you do not want your script to be
sensitive to the state of the timer. For example, you can test
whether the state is TS_STARTED, and, if not, start the timer
before continuing with the rest of the script.
Example
HTIMER TotalTimer
TotalTimer = TimerCreate () // make a timer handle
TimerStart (TotalTimer) // initialize & start a timer
TimerPause (TotalTimer) // pause the timer
// ...
Print (TimerState (TotalTimer)) // prints: TS_PAUSED
TimerDestroy (TotalTimer) // destroy the timer handle