NYCPHP Meetup

NYPHP.org

[nycphp-talk] Re: php setTimeout ?

Brian Pang bpang at bpang.com
Mon Jul 7 14:13:59 EDT 2003


I'll go ahead and answer my own question here before it even makes it to
the list in the event that it edifies others.

The sleep() and usleep() functions [whole seconds and 1/1,000,000 second
increments, respectively] provide this ability, and they're better than
setTimeout() because they work inline, rather than having to make calls
to another function.

Now you, too, can slow your applications down to 1994 speeds and
earlier! FUN!

Or, Jay, you could possibly use this to simulate a slow connection or
really screw up the speed test results.



> 
> Hi Brian,
> 
> Please repost to talk at lists.nyphp.org
> 
> Sorry for the trouble,
> 
> NYPHP
> 
> 
> 
> Brian Pang wrote:
> 
> > Is there a php equivalent of javascript's setTimeout method?
> > 
> > or some other way to slow down a script?
> > 
> > I'm sure I could kludge some inefficient loop and wait for it to finish
> > before proceeding, but that would just be dumb.
> > 
> > Looking for something that is actually measurable/adjustable and that
> > doesn't create undue load on the server.
> > 
> > thanks
> > 
> > 
> 
> 
> 






More information about the talk mailing list