From: CaptSushekECF at aol dot com Operating system: Apache PHP version: 5.0.5 PHP Bug Type: Unknown/Other Function Bug description: sleep() not always accurate
Description: ------------ When running sleep(), I noticed it does not always pause the script for the exact amount of time. Although the difference is no doubt neglectible, it is still noteable. Reproduce code: --------------- <?php $st = array_sum (explode (' ', microtime ())); sleep (1); echo round ((array_sum (explode (' ',microtime ())) - $st), 7); ?> Expected result: ---------------- I expect to see values ranging around 1.0000001 to 1.01 (depending on lag). Actual result: -------------- It returned the following: (including server lag) 0.9998388 0.9999161 1.001672 -- Edit bug report at http://bugs.php.net/?id=35355&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35355&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=35355&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=35355&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=35355&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35355&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35355&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35355&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35355&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35355&r=support Expected behavior: http://bugs.php.net/fix.php?id=35355&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35355&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35355&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35355&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35355&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35355&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35355&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35355&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35355&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35355&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35355&r=mysqlcfg