Sgqvur
FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
- Reaction score
- 62
Which is the lowest value that a timer period can be set and it will execute it's code after it's expiration?
I am getting results of 10 004 per second as a maximum value. The snippet I use to test:
Is the speed determined by the computer's internal timer and cpu or is it the 10 004 a sort of like the light speed barrier?
Not that I need something to be done 10 004 times per second but still... just curious.
Edit: actually with a value of zero I get 10 084 times per second =): [ljass]TimerStart(t, 0, true, function inc_i)[/ljass]
I am getting results of 10 004 per second as a maximum value. The snippet I use to test:
JASS:
globals
integer i = 0
timer t = CreateTimer()
timer t2 = CreateTimer()
endglobals
function stop_t takes nothing returns nothing
call PauseTimer(t)
call BJDebugMsg("i = " + R2S(i))
set i = 0
endfunction
function inc_i takes nothing returns nothing
set i = i + 1
endfunction
function test_timer_speed takes nothing returns nothing
call TimerStart(t, 0.0002, true, function inc_i)
call TimerStart(t2, 1.0, false, function stop_t)
endfunction
function InitTrig_timer_speed takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerEventEndCinematic(t, Player(0))
call TriggerAddAction(t, function test_timer_speed)
endfunction
Is the speed determined by the computer's internal timer and cpu or is it the 10 004 a sort of like the light speed barrier?
Not that I need something to be done 10 004 times per second but still... just curious.
Edit: actually with a value of zero I get 10 084 times per second =): [ljass]TimerStart(t, 0, true, function inc_i)[/ljass]