开发者

What is the correct, cross-platform way to sleep for less than a second? [duplicate]

This question already has answers here: How to pause a script just for a fraction of a second in PHP using the 开发者_如何学GoSLEEP() function? (4 answers) Closed 3 years ago.

I want my script's execution to pause for about a half of a second.

While looking at the PHP documentation's user comments, I found multiple functions that purported to be able to do this. But, for each function, there was at least one poster who claimed that it was wrong and that they had a better way of doing it, and so-on and so-forth.

Thanks,


The first function I would try is usleep. From the docs:

Delays program execution for the given number of micro seconds.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜