I have spent DAYS trying to create a reliable usleep()-replacement for Windows.
I have only this to offer:
As commented by someone else already, the gettimeofday() method used below is useless - PHP will use all available CPU power doing nothing.
The fsockopen() method apparently is also useless - as someone else commented, an fclose() was missing in the original post, but this apparently does not solve the problem. After calling the function about 50 or so times, fsockopen() returns immidiately, without any delay - and watching a process monitor in Windows, you can then watch the process taking up increasingly more memory, until eventually PHP aborts (or crashes) when it reaches maximum.
The win32api-method is also a no-go ... after calling the Sleep function a few hundred times (during which memory usage will also go up every time due to a memory leak somewhere), PHP will cause an exception and Windows will terminate it.
I have given up - I don't think there is any viable solution to this problem under PHP 4.
If you need this function, upgrade your project to PHP 5.
Or settle for 1-second delays with the sleep()-function.
These, unfortunately, seem to be your only options...