#36410 [Opn->Csd]: usleep() do strange behavior
| From: | tony2001@php.net | Date: | Thu, 16 Feb 2006 10:18:47 +0000 |
| Subject: | #36410 [Opn->Csd]: usleep() do strange behavior | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-93323@lists.php.net to get a copy of this message | ||
ID: 36410
Updated by: tony2001@php.net
Reported By: sqchen at citiz dot net
-Status: Open
+Status: Closed
Bug Type: Unknown/Other Function
Operating System: redhat 7.3
PHP Version: 5.1.2
New Comment:
While I agree, this function should not allow using negative values
(fixed in CVS), float values are ok, as long as they are autoconverted
to a valid integer.
That's where the problem comes from: float -> int convertion may end up
with negative integer value, even though float value was positive.
Previous Comments:
------------------------------------------------------------------------
[2006-02-16 08:56:55] sqchen at citiz dot net
Description:
------------
there are two questions:
first: usleep(214748000009);
usleep(214749000009);
second: usleep(-1);
usleep(-214748000009);
Actual result:
--------------
first: usleep(214748000009) wait for a long time (I am not sure
hong long?)
usleep(214749000009) wait for 1 second
second: usleep(-1) wait for a long time
usleep(-214748000009) wait for 0 second
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36410&edit=1