Timer

Labels: :IA_Function:IA_Timer
Inherits from: Function

Counts down from a set time and fires triggers when time depletes.

Parameters

Key Description Default value Possible values
interval [Required] Time in ms to count down from. number
repeat Set the timer to repeat when it reaches 0. false boolean
pause When set to true, the timer does not continue. false boolean
reset When set to true, the timer will restart counting. This property will reset to false directly after it is set to true. false boolean
limit When repeat is set to true, this will limit the number of repetitions. 10 number

Note: Use the basic kill parameter to stop the timer (after which it cannot be resumed).

Output triggers

Type: end

Occurence: When the timer reaches 0.

No Additional event properties besides the inherited properties.

Additional Function state properties:

Key Description Possible values
_function.start Timestamp (in seconds since 01-01-1970) when timer was started. number
_function.running Whether the timer is running or not. boolean
_function.remaining Number of milliseconds remaining number
_function.iteration The current iteration (starting at 1) string
_function.end Timestamp (in seconds since 01-01-1970) when timer will end. string

Tip: at any moment, the current state of the timer can be read by executing an Update Trigger towards the Timer, (without setting any parameters) and catching the functionUpdated event with an outgoing Trigger from the Timer.