DoctorSLO Posted March 4, 2009 Share Posted March 4, 2009 Hi. I was wondering if there is some other option than that TimerInit, because it takes 100% of CPU I have a script which do tasks on the time u entered E.g. one task for 3 hours and 5 min and other for 5 hours and 13 min. I make code like this: $Timer = _Timer_Init() While 1 Select Case _Timer_Diff($Timer) >= $Spi1 $Spi1 = 9999999999999999999999999 Nadgradi() Case _Timer_Diff($Timer) >= $Spi2 $Spi2 = 9999999999999999999999999 Nadgradi() EndSelect WEnd $Spi1 and $Spi2 are declared before this. So is there some other option how to do that? Link to comment Share on other sites More sharing options...
Developers Jos Posted March 4, 2009 Developers Share Posted March 4, 2009 Your script take 100% because you have a loop without any Sleep() in it. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Marlo Posted March 4, 2009 Share Posted March 4, 2009 (edited) $Timer = _Timer_Init() While 1 Select Case _Timer_Diff($Timer) >= $Spi1 $Spi1 = 9999999999999999999999999 Nadgradi() Case _Timer_Diff($Timer) >= $Spi2 $Spi2 = 9999999999999999999999999 Nadgradi() EndSelect sleep(5) WEnd increase the sleep duration from 5 if you still get problems. Edited March 4, 2009 by Marlo Click here for the best AutoIt help possible.Currently Working on: Autoit RAT Link to comment Share on other sites More sharing options...
DoctorSLO Posted March 4, 2009 Author Share Posted March 4, 2009 Thanks for help, it's OK now 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