You probably want to look at sleep, not exit.
Being right, does not endow the right to be rude; politeness costs nothing. Being unknowing, is not the same as being stupid. Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence. Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
| [reply] |
exit will cause the process to stop running. To restart
it and pick up at another location, you'd have to save
some sort of data before exiting that would tell you where
to pick up, then load and use that data to conditionally
execute code on restart. This doesn't sound like a good
design to me. Are you sure you don't want to just sleep
for 3 seconds, then continue on?
| [reply] |
Tried but it doesn't work the way I want cause when I use sleep(3); it doesn't display what I already have processed on the browser it just seats there and of course "sleep" for 3 seconds. and using exit displays everything at that point to the browser, I just need some similar trick to display whatever at some point in my program and than move on.
| [reply] |
if you're trying to get things to display to the browser, there are other things to do:
$|++;
to force writes to be "immediate". (i'm forgetting the proper term .. not enough coffee yet this morning ... )
the reason exit is sending the output to the browser is because the write buffer is closed, like a close on a filehandle. | [reply] [d/l] [select] |
| [reply] |
It sounds like you are developing a CGI application. If this is the case, turning off output buffering may ensure that the output from the script is displayed in the browser:
$|++;
| [reply] [d/l] |
I think your best bet is to sleep the process rather than terminating it. | [reply] |