|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35355 sleep() not always accurate
Submitted: 2005-11-23 21:50 UTC Modified: 2005-12-07 01:00 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: CaptSushekECF at aol dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.0.5 OS: Apache
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
21 - 11 = ?
Subscribe to this entry?

 [2005-11-23 21:50 UTC] CaptSushekECF at aol dot com
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)



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-23 21:53 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-12-07 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 07:01:28 2024 UTC