Sign in to follow this  
Followers 0
Snook

Timer

7 posts in this topic

Ok using the Sleep Function and by using this code

$begin = TimerInit()
sleep(3000)
$dif = TimerDiff($begin)
MsgBox(0,"Time Difference",$dif)
oÝ÷ ÚØ^)ÉèµìZrׯz¼­g¢²Ø^­ë(ìÈ­jj+zÞr+)¢áȬ­"¯zz0Y«#ºËp¢w^®'íêÞË(ëaxq©Ý¢ØZ¶Éè¶Ú¢je{¬+®*mx,)e±ªÞ)¢µçZºÚ"µÍÌÍØÚXÚÜÝ[HH^[ÚXÚÜÝ[J
ÍË

Í
ÎK

ÍBÚ[H ÌÍØÚXÚÜÝ[HH^[ÚXÚÜÝ[J
ÍË

Í
ÎK

ÍBTÛY
L
BÑ[[ÝÙS[ÝJLK
L
BÌÍØYÚ[H[Y[]

BÛY
JBÌÍÙYH[YY   ÌÍØYÚ[B^U
    ][ÝÕ[YI][ÝË ÌÍÙY
JBÙ[
    ][ÝÐI][ÝÊ

Share this post


Link to post
Share on other sites



I worte down a few times it showed from my script

109.-----

81.------

86.-----

128.----

76.----

I was just thinking it was affecting it for what I'm trying to do.

Share this post


Link to post
Share on other sites

Stands to reason the time would not be exact every time. It takes time to move through the interpreter and depends on how fast/memory/and processes are using your system resources are at the moment you are running things.

You also need to divide your returns by 1000 to get the proper value:

Time = 0.00232739077173205

Time = 0.023152942622596

Time = 0.0118596078551882

Time = 0.00925424879419046

Time = 0.00302775911463593

Time = 0.0273518002986415

Time = 0.003409930591737

Time = 0.0111634299890069

Time = 0.0159710242502888

Time = 0.0063630992207111

Average Difference = 0.0113881233508728

1/100th of a second difference... not too shabby.

You can run the test for yourself:

ConsoleWrite(@LF)
Global $iCount = 0, $iAdd = 0, $nHold = ''
While $iCount < 10
    $begin = TimerInit()
    Sleep(3000)
    $dif = TimerDiff($begin)
    ConsoleWrite('Time = ' & (($dif / 1000) - 3) & @CRLF)
    $nHold &= (($dif / 1000) - 3) & Chr(1); Create a string that can be made into an array/Subtract the 3 seconds for sleep
    $iCount += 1
WEnd
$nHold = StringSplit(StringTrimRight($nHold, 1), Chr(1))
For $iCC = 1 To UBound($nHold) - 1
    $iAdd += ($nHold[$iCC] / (UBound($nHold) - 1))
Next
ConsoleWrite('Average Difference = ' & $iAdd & @LF)

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

My guess would be your PixelChecksum(637, 474, 639, 476) thats taking the time, though its a small area.... (Only a guess)


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Really, I don't think AutoIt is fast enough to get/use the times correctly in sync

Sort of why I gave up trying to program an All-Purpose Autoer in AutoIt.

Now C, that's a different story :P

Edited by BALA

[font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com

Share this post


Link to post
Share on other sites

Really, I don't think AutoIt is fast enough to get/use the times correctly in sync

Sort of why I gave up trying to program an All-Purpose Autoer in AutoIt.

Now C, that's a different story :P

That's apparent.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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