thimker Posted January 5, 2005 Share Posted January 5, 2005 I don't know enough to say how much CPU load is needed to use SLEEP() for long intervals, e.g., 4 hours. Is there a simple but less demanding way to do this. I thought about trying @HOUR and watching until the value changes by specified integer, but putting that in a WHILE loop would also take a lot of CPU ticks. I'd like to run a program at n-hour intervals or at specific hours. Perhaps one could use SELECT CASE, but how to run program only once each time? // thnx [i could not come up with good terms for SEARCH.] Link to comment Share on other sites More sharing options...
Chris_1013 Posted January 5, 2005 Share Posted January 5, 2005 You could always think about taking the running of the program every n-hours out of the script all together. There are programs already designed to do this, such as the Windows Scheduler. Link to comment Share on other sites More sharing options...
Luke Posted January 5, 2005 Share Posted January 5, 2005 I don't know enough to say how much CPU load is needed to use SLEEP() for long intervals, e.g., 4 hours. Is there a simple but less demanding way to do this. I thought about trying @HOUR and watching until the value changes by specified integer, but putting that in a WHILE loop would also take a lot of CPU ticks. I'd like to run a program at n-hour intervals or at specific hours. Perhaps one could use SELECT CASE, but how to run program only once each time? // thnx[i could not come up with good terms for SEARCH.]<{POST_SNAPBACK}>I wondered the same thing when I wanted to run a monitoring script (an .exe) that would repeat Sleep(95 * 1000) ad infinitum. The machine is an XP Home, Athlon XP 2000. As a rough test, I shut down most processes to bring the resource meter's CPU Usage reading to a quiescent state. It oscillated slowly between 0% and 0.05%. The script running made no observable difference. Link to comment Share on other sites More sharing options...
sugi Posted January 5, 2005 Share Posted January 5, 2005 When you're using bigger Sleep() values (AFAIR Jon mentioned something about >20 ms?) AutoIt just tells windows to wake it up in X milliseconds. So AutoIt doesn't use any CPU at that time. Windows is responsible for that. This is of course IIRC and I'm no developer. But whatever you're doing, you won't be able to do a less CPU consuming method written in AutoIt script. Link to comment Share on other sites More sharing options...
thimker Posted January 5, 2005 Author Share Posted January 5, 2005 Thanks to all. Very reassuring. "The easiest is the bestest" in this case. 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