endofworld Posted May 11, 2012 Posted May 11, 2012 Hi all expert, is there anyway to pause my script for 30minutes after 1 hour or so?
endofworld Posted May 11, 2012 Author Posted May 11, 2012 What i mean is to pause the script for few minutes or hours and start it again after every 1 hour or earlier.
James Posted May 11, 2012 Posted May 11, 2012 Wrong place. And can't you edit a post? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Colyn1337 Posted May 11, 2012 Posted May 11, 2012 (edited) There are far too many ways to interpret what you want to do, which leads to many more possibilities for a solution. When you can, please clarify your intentions. My first thought is to make whatever program/script you're making a scheduled task. You could also play around with the Sleep() and _Date_Time_GetSystemTime() in a For/Do or Do/Until loop........ Anyways, there are infinite possibilities (thanks to the dev team)... Edited May 11, 2012 by Colyn1337
endofworld Posted May 13, 2012 Author Posted May 13, 2012 Is there any guides for me to do so? I need a guide in pausing my script for few minutes then start again automatically, is that possible?
searchresult Posted May 13, 2012 Posted May 13, 2012 Something like this? Yu have it in help file... $hTimer = TimerInit() ; Begin the timer and store the handle in a variable. $sleepTime = 3000 ;sleep is in ms if you want in seconds * 1000 (script pause time) $time = 3 600 000 ;1 hour in ms (Time for scrip to run) While 1 $iDiff = TimerDiff($hTimer) ; Find the difference in time from the previous call of TimerInit. The variable we stored the TimerInit handlem is passed as the "handle" to TimerDiff. If $iDiff >= $time Then Sleep($sleepTime) MsgBox(0, "Msg", "Script was running for " & $time) ExitLoop EndIf WEnd
VixinG Posted May 14, 2012 Posted May 14, 2012 (edited) Hi all expert, is there anyway to pause my script for 30minutes after 1 hour or so? I would add AdlibRegister like that: AdlibRegister("SleepTime",3600000) ; SleepTime() every 1 hour Func SleepTime() Sleep(1800000) ; 30 min ;AdlibUnregister("SleepTime") ;if you want just once EndFunc Edited May 14, 2012 by VixinG [indent=3][/indent]
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