HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Do 0.0 timers execute callbacks in order?

08-06-2007, 04:48 PM#1
Rising_Dusk
Quick question that I'm unable to test myself right now.

If I have two timers and do this...
Collapse JASS:
call TimerStart(MyTimer1, 0., false, function SomeFunc)
call TimerStart(MyTimer2, 0., false, function SomeFunc)
Will MyTimer1 hit the callback first? Or will MyTimer2?
Or is it random?
08-06-2007, 04:53 PM#2
Skater
Just check it with something like this:
Collapse JASS:
if GetExpiredTimer()==Timer1 then
    call BJDebugMsg("Timer1 expires")
else
    call BJDebugMsg("Timer2 expires")
endif

Ofcourse you need global timer.
08-06-2007, 04:55 PM#3
Rising_Dusk
Quote:
Quick question that I'm unable to test myself right now.
If I were home, I would have already tested it instead of asking.
08-06-2007, 05:04 PM#4
Vexorian
we don't need to know.

I once discussed something related to this with weaaddar, the best thing for 0 seconds timers is to just use a queue for the data instead of attaching things, in case two 0 timers were started like this, the queue would simply do the things in order, which I guess is the expected behavior.

It would be odd though if it was random, don't know how to test anyways
08-06-2007, 06:09 PM#5
Ammorth
As far as my tests showed, they do execute in order.
08-06-2007, 07:04 PM#6
Rising_Dusk
Quote:
As far as my tests showed, they do execute in order.
Good, thank you.
08-07-2007, 01:37 AM#7
PipeDream
Do you really trust Blizzard that much? At all?