CAPL Script

IsTimerActive

Syntax

int isTimerActive(timer t)

int isTimerActive(mstimer t)

Function

Return value indicates whether a specific timer is active. This is the case between the call to thesetTimerfunction and the call to theon timerevent procedure.

Parameters

timerormstimervariable

Return Values

1, if the timer is active; otherwise 0.

0 is also returned within theon timer eventprocedure.

timer t;write("Active? %d", isTimerActive(t)); // writes 0setTimer(t, 5);write("Active? %d", isTimerActive(t)); // writes 1

[setTimer](/en/syntax/general/timers/settimer) | [cancelTimer](/en/syntax/general/timers/canceltimer) | [timeToElapse](/en/syntax/general/time/timetoelapse)