HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

? about timers...

09-25-2006, 04:29 AM#1
darkwulfv
Do timers count in real-time seconds or game-time seconds?
09-25-2006, 04:48 AM#2
The_AwaKening
Timers count in GameTime seconds, taking into consideration lag and such.
09-25-2006, 04:59 AM#3
darkwulfv
Ok thanks, but I have another question.
In the Native, TimerStart, these are the parameters.

Collapse JASS:
takes timer whichTimer, real timeout, boolean periodic, code handlerFunc returns nothing

I have whichTimer, timeout, and periodic filled, but I don't know what they mean by code handlerFunc. Anyone know the answer?
09-25-2006, 05:14 AM#4
The_AwaKening
That would be a function that runs at the Timer Expiration. Set to null if you aren't going to use it.

Very simple example:
Collapse JASS:
function TimerEnd takes nothing returns nothing
 local timer t = GetExpiredTimer()
    call DoNothing()
endfunction

function Timer takes nothing returns nothing
 local timer t = CreateTimer()
    call TimerStart(t,40,false,function TimerEnd)
endfunction
09-25-2006, 10:50 AM#5
blu_da_noob
Code is the function to be run when the timer expires (with the GetExpiredTimer() even response). As pointed out above, use null if you don't want it.
09-25-2006, 11:32 AM#6
darkwulfv
Ok thank you guys!