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

timeToElapse

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

Function Syntax

long timeToElapse(timer t); // from 1
long timeToElapse(mstimer t); // from 2

Method Syntax (Dynamic)

Method Syntax
long msTimer::timeToElapse();

Description

Returns a value indicating how much more time will elapse before an on timer event procedure is called. For form 1, the time value is returned in seconds; for form 2, the time value is returned in milliseconds. If the timer is not active, -1 is returned. This is also the case in the on timer event procedure itself.

Parameters

  • timer or mstimer variable

Return Values

Time to go until the timer elapses and the event procedure is called.

Example

timer t;
setTimer(t, 5);
write("Time to elapse: %d", timeToElapse(t)); // writes 5
Class: Timer, MS TimersetTimercancelTimerisTimerActive