Every time you use this function:
You call this JASS function:
function DoNothing takes nothing returns nothing
endfunction
Which takes up valuable processing time.
By choosing not to use call DoNothing()
, you win 12.3% speed increase!
call DoNothing()
+return
executed 2162 times per milisecond.
//null
+return
executed 26668 times per milisecond.
The real benefit of not using call DoNothing()
is 0.00046 ms per call.
July 4th, 2010 at 6:36 pm
Really? O.o never knew that.
July 7th, 2010 at 2:45 pm
awesommmme
January 18th, 2012 at 8:45 am
So i might as well leave it blank after Else - Actions?
January 18th, 2012 at 8:45 am
Yup.
June 23rd, 2012 at 8:57 am
hey i need help can yu help
June 23rd, 2012 at 9:34 am
Of course!
March 4th, 2023 at 8:27 pm
Hi, First of all I'm sorry for 10 year old thread bump, But may I ask how did you managed to calculate those results?
I really need to measure executing time of a trigger coded in various styles/methods to choose what's the best form of it.
A response would be a BIG help! Thanks in advance.
March 6th, 2023 at 3:46 am
Sure, timing in any programming language works like this:
Start a timer or note down the current milliseconds / tick count.
Start a loop, one million iterations should give accurate results.
Call the function many, many times!
Stop the timer or subtract tick count from the one you saved.
Divide the difference by the iterations.