jvanegmond Posted February 28, 2009 Share Posted February 28, 2009 Although, no one has confirmed why Sleep with parameters from 1 through 10 always sleeps 10 milliseconds. I will definitely be using the high precision sleep from now on, that monoceres wrote. github.com/jvanegmond Link to comment Share on other sites More sharing options...
CodyBarrett Posted March 3, 2009 Share Posted March 3, 2009 why Sleep with parameters from 1 through 10 always sleeps 10 milliseconds.im not sure but uhh yeah it may depend on the computer resources like what was already said earlier.... but i dont know lol is it ACTUALLY 10ms EVERY SINGLE time on EVERY Computer, i have no time to test this out. [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted March 3, 2009 Share Posted March 3, 2009 im not sure but uhh yeah it may depend on the computer resources like what was already said earlier.... but i dont know lol is it ACTUALLY 10ms EVERY SINGLE time on EVERY Computer, i have no time to test this out.You don't need to do any lengthy test, simply run this code, you will see that the first is around 10ms while the second will be around 100. I can confirm this on both single- and multi-core systems. $Timer = TimerInit() Sleep(10) ConsoleWrite("One 10ms sleep=" & TimerDiff($Timer) & @CRLF) $Timer = TimerInit() For $X = 1 To 10 Sleep(1) Next ConsoleWrite("Ten 1ms sleep=" & TimerDiff($Timer) & @CRLF) .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 Link to comment Share on other sites More sharing options...
herewasplato Posted March 3, 2009 Share Posted March 3, 2009 http://www.autoitscript.com/forum/index.ph...st&p=341362So, that change was made in 2007... here are posts that "worried" about sleep before that. They have several methods of seeing how "sleeps" and "sleep UDFs" perform - and questions about types of loops:http://www.autoitscript.com/forum/index.php?showtopic=13415http://www.autoitscript.com/forum/index.php?showtopic=13335http://www.autoitscript.com/forum/index.php?showtopic=13605Culminating in a sleep UDF from 2005http://www.autoitscript.com/forum/index.php?showtopic=13834Well, it is about time that someone brought this up again.I'll never be able to sleep until this is settled. :-) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Richard Robertson Posted March 3, 2009 Share Posted March 3, 2009 Those are even worse than the puns I was throwing at my friends last night. Link to comment Share on other sites More sharing options...
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