** BEGIN DISCLAIMER **
The following is all based on my experience using timer.*
AFAIK, this is not officially documented, so behaviors could in theory change.
** END DISCLAIMER **
A member of our community asked an interesting question in the ‘Slack’ #random channel and I answered.
Then I thought, hmm… this would make a good random forums post too:
Timer events behave as follows:
Order Of Execution (same times)
timer.performWithDelay( 100, funcA ) timer.performWithDelay( 100, funcB )
-
funcA will always be executed before funcB
Order Of Execution (different times) Example #1timer.performWithDelay( 100, funcA ) timer.performWithDelay( 10, funcB )
-
funcB will always be executed before funcA
Order Of Execution (different times) Example #2timer.performWithDelay( 5, funcA ) timer.performWithDelay( 10, funcB )
-
funcA will always be executed before funcB
-
Neither function will be executed any sooner than the next frame, AND funcB will happen immediately after funcA (there will be no 5ms separation).
-
Because both timers are less than a frame duration, they are fully elapsed by the time the next frame starts, thus they trigger right away.
Minimum Durations Example #1timer.performWithDelay( 1, funcA ) timer.performWithDelay( 1, funcB )
-
funcA will always be executed before funcB
-
Neither function will be executed any sooner than the next frame.
Minimum Durations Example #2timer.performWithDelay( 0, funcA )
-
funcA will be executed this frame (last time I checked this was true)