Skip to main content
Open topic with navigation CAPL Functions » General » Function Overview » isTimerActive

isTimerActive

Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DE

Function Syntax

  • int isTimerActive(timer t); // form 1
  • int isTimerActive(mstimer t); // form 2

Description

Return value indicates whether a specific timer is active. This is the case between the call to the setTimer function and the call to the on timer event procedure.

Parameters

  • timer or mstimer variable

Return Values

  • 1, if the timer is active; otherwise 0.
  • 0 is also returned within the on timer event procedure.

Example

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