jeboy Posted June 16, 2008 Share Posted June 16, 2008 We know that sleep() function will delay the script execution, now I would like to ask if what will happened if for example, at certain condition the script pauses for a moment (e.g. 60 seconds) then halfway of the pause duration, I refreshed the page or revisited the page, what will happen to the script? Does sleep() function continues? Link to comment https://forums.phpfreaks.com/topic/110359-question-about-sleep-function/ Share on other sites More sharing options...
bluejay002 Posted June 16, 2008 Share Posted June 16, 2008 why would you do that? just sleep for 30sec then do your stuff then sleep again for another 30sec. Link to comment https://forums.phpfreaks.com/topic/110359-question-about-sleep-function/#findComment-566223 Share on other sites More sharing options...
jeboy Posted June 16, 2008 Author Share Posted June 16, 2008 It's just a figure, an example to show the scenario. The simple question is, what if the page is refreshed or revisited, will the sleep() function continues? Link to comment https://forums.phpfreaks.com/topic/110359-question-about-sleep-function/#findComment-566225 Share on other sites More sharing options...
bluejay002 Posted June 16, 2008 Share Posted June 16, 2008 well actually, sleep is on the server side... once the page has been refreshed which is on the client-side, it will send a new request to the server and the script will parsed again right from the start. that's my opinion though since i haven't used sleep before. making the server sleep for 60secs... why would you need one? may i know? Link to comment https://forums.phpfreaks.com/topic/110359-question-about-sleep-function/#findComment-566226 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.