TimerStart

Parameters
whichTimer timer

Handle to timer.

timeout real

Delay in seconds.

periodic boolean

True: repeat timer after expiration (loop). False: timer only runs once.

handlerFunc code

Callback function to be executed when timer expires.

comment

Starts a previously created timer that calls a function when timeout reaches 0.

It is affected by gamespeed at any point of it execution, if the gamespeed is changed at 50% of timeout duration, the rest of the timeout will be correctly affected by new gamespeed.

note

See: GetExpiredTimer to retrieve the handle of the expired timer inside handlerFunc.

note

The table below shows how often a 0 millisecond timer is executed in comparison with TriggerRegisterTimerEvent (aka TriggerRegisterTimerEventPeriodic).

Trigger or Timer \ Tick count ROC 1.0 Reforged 1.32.10
1000ms Trigger periodic 1 Hz 1 Hz
100ms Trigger periodic 10 Hz 10 Hz
20ms Trigger periodic 50 Hz 50 Hz
10ms Trigger periodic 100 Hz 100 Hz
5ms Trigger periodic 200 Hz 100 Hz
1ms Trigger periodic 1000 Hz 100 Hz
0ms Trigger periodic 10077 Hz 100 Hz
1ms Timer 1000 Hz 1000 Hz
0ms Timer 10077 Hz 10077 Hz
patch

1.00

Source
common.j
return type
nothing
Source code
native TimerStart           takes timer whichTimer, real timeout, boolean periodic, code handlerFunc returns nothing