- Joined
- Jun 23, 2007
- Messages
- 4,066
Apparently timers with a zero second duration will iterate 10,000+ times a second, while a one with a 0.01 timer will obviously be 100 times a second. Each decimal lower adds another zero.
So a zero second timer is exactly the same as
Nothing special, just maybe someone is curious.
JASS:
globals
integer array inc
endglobals
function foo takes nothing returns nothing
set inc[0] = inc[0] + 1
endfunction
function bar takes nothing returns nothing
set inc[1] = inc[1] + 1
endfunction
function display takes nothing returns nothing
call ClearTextMessages()
call BJDebugMsg("inc[0]=" + I2S(inc[0]))
call BJDebugMsg("inc[1]=" + I2S(inc[1]))
endfunction
//===========================================================================
function InitTrig takes nothing returns nothing
call TimerStart(CreateTimer(), 0, true, function foo)
call TimerStart(CreateTimer(), 0.01, true, function bar)
call TimerStart(CreateTimer(), 1, true, function display)
endfunction
JASS:
call TimerStart(CreateTimer(), 0.0001, true, function bar)