What is the right cross-platform way to sleep for less than a second?

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

While looking at the comments of users of the PHP documentation, I found several functions that are supposed to be able to do this. But for each function, there was at least one poster that claimed it was wrong, and that they had the best way to do it, and so on and so forth.

Thank,

+5
source share
1 answer

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

Program execution delay for a given number of microseconds.

+5
source

All Articles