Sign in to follow this  
Followers 0
blizzedout

Find the avg seconds

4 posts in this topic

I want to find out the avg amound of seconds it takes for the:

While statement to run.

Like i want to use _NowTime() and a run count, and find the time difference from run 1 and run 2 then lets say you get 4 seconds adds that to a $time var, then divides that by a $runs var and bam you should be able to get it?

Anyone know if this will work or aready have something liek this?

Share this post


Link to post
Share on other sites



Try using TimerInit and TimerDiff. It will be much more accurate (milliseconds vs seconds).

Share this post


Link to post
Share on other sites

Try using TimerInit and TimerDiff. It will be much more accurate (milliseconds vs seconds).

thanks lol, just getting into the time section of AI

Share this post


Link to post
Share on other sites

thanks lol, just getting into the time section of AI

Cool through it together to see if it works and it does :o

Average Time

$Runs = 0
$Total= 0
While 1
$begin = TimerInit()
sleep(1000)
$dif = TimerDiff($begin)
$Total = $Total + $dif
$Runs = $Runs + 1
$avg = $Total / $Runs
MsgBox(0,"Time Average","Total Time: " & $Total & @CRLF & "Average Time: " & $avg)
Wend

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0