Rydextillxixdiex Posted June 23, 2008 Posted June 23, 2008 Is there a more time accurate way to pause your scripts as Sleep is in fact very inaccurate to the point where it is sometimes five seconds off. ...will never learn all there is to know about autoit, no worries...i came to the forums :)
enaiman Posted June 23, 2008 Posted June 23, 2008 _Timer_Init and _Timer_Diff (help file) SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
Rydextillxixdiex Posted June 23, 2008 Author Posted June 23, 2008 From what the help file expresses, these are timer functions. They just "count" time and is capable of displaying it in a tooltip, can this be used in a similar way as sleep can? Sorry but help file was no help here please explain more. ...will never learn all there is to know about autoit, no worries...i came to the forums :)
Richard Robertson Posted June 23, 2008 Posted June 23, 2008 What do you mean that sleep is inaccurate? I'm sure that the function calls the sleep command through Windows threading. Even if that is wrong, I have never seen sleep do that. Have you tested different versions of AutoIt and/or different computers? Maybe you have a bad install or bad system.
enaiman Posted June 23, 2008 Posted June 23, 2008 IMO "sleep" is accurate. If you don't want to use any sleep - then you can always use _Timer_Init and _Timer_Diff at the cost of CPU performance. #Include <Timers.au3> $start = _Timer_Init() Do $end = _Timer_Diff($start) Until $end > 5000 MsgBox(0, "Time", "Elapsed Time: "&$end) SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :)
AdmiralAlkex Posted June 23, 2008 Posted June 23, 2008 Is there a more time accurate way to pause your scripts as Sleep is in fact very inaccurate to the point where it is sometimes five seconds off.According to Ludocos thread HERE Sleep() should not be off more than around 10ms, there must be some seriously problems with your computers if it's five seconds!! .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
TurionAltec Posted June 23, 2008 Posted June 23, 2008 Looking at some of your previous posts it looks like you're automating a game, which are generally CPU intensive, so Windows might not be giving your script the CPU time it needs. Try increasing the priority of the script with ProcessSetPriority() ProcessSetPriority(@AutoItPID,4) That should set the priority of the script to High.
Rydextillxixdiex Posted June 23, 2008 Author Posted June 23, 2008 Your right i often am, and thanks for your time i will test this. ...will never learn all there is to know about autoit, no worries...i came to the forums :)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now