TimerStart
- Parameters
whichTimer timerHandle to timer.
timeout realDelay in seconds.
periodic booleanTrue: repeat timer after expiration (loop). False: timer only runs once.
handlerFunc codeCallback 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:
GetExpiredTimerto 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(akaTriggerRegisterTimerEventPeriodic).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 (suggest an edit or discuss on Github)
- return type
nothing- Source code
native TimerStart takes timer whichTimer, real timeout, boolean periodic, code handlerFunc returns nothing