• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Fastest loop method?

Status
Not open for further replies.

Deleted member 219079

D

Deleted member 219079

Which is fastest looping method out of these ones:

TimerUtils (Timer utility script for wc3: http://www.wc3c.net/showthread.php?p=1020244)
Traditional loop trigger
Timer - powered loop function
Something else (what)?

I myself don't like loop trigger and loop functions, they loop through every index at once.
 

Deleted member 219079

D

Deleted member 219079

It's a native, call TimerStart().
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
I dont understand your question fully, but its always fastest to do

JASS:
loop
    //stuff
    exitwhen condition
endloop

because it will run sequentually until the thread crushes or unitl the conditions is met whereas with periodic timer will have to wait every so often

Correct me if Im wrong, or explain a bit more of the question so I can understand better what you mean
 

Deleted member 219079

D

Deleted member 219079

Uhh... you just gave me a part of function :/ I mean loop, as a thing that happens continuously, like every 0.03125 seconds. Which is the most performance-wise fastest way to perform that kind of script?
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
ah ok you mean like firing something every so often? Single periodic timer should be more than enough. The timeout is up to you to decide, but the heavier the function you call is, the less often it should be called. 0.03125 is standard, but you can go lower, or higher if you dont need so many iterations every second
 

Deleted member 219079

D

Deleted member 219079

Hm, ok.
As TimerUtils make it super easy though, I will make both TimerUtils and periodic timer method, then I'll benchmark their FPS.
 

Deleted member 219079

D

Deleted member 219079

Yeah you're right I don't need TimerUtils, I can do everything in a loop. I just like to keep it simple, with GetTimerData() I can get the struct and perform the loop easily. But don't worry I'll still do it the way you suggested it too, I'll keep the one which'll turn out to be the faster one.
 
Status
Not open for further replies.
Top