Forum Moderators: coopster

Message Too Old, No Replies

how do you make a script wait

I would like to pause execution for a few seconds

         

meingallsphp

6:08 pm on Jul 8, 2007 (gmt 0)

10+ Year Member



I would like to introduce a short period of waiting time in a script. In the online manual, I found a PHP function called m_uwait that is supposed to do just that for a specified number of microseconds, but when I ran the script, m_uwait came up as undefined.

Does anyone know of a way to pause execution for a few seconds?

Thank you

jatar_k

6:22 pm on Jul 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could try

[php.net...]

though read through the comments as well, especially the bottom one. You may need to use flush() with it. I have used it with success though.

This isn't always the best approach. If you need to do the same task over and over it is sometimes more efficient to use a cron instead.

meingallsphp

8:55 pm on Jul 8, 2007 (gmt 0)

10+ Year Member



Thank you!