note 62456 deleted from function.sleep by danbrown
| From: | danbrown@php.net | Date: | Sat, 14 Mar 2009 14:37:44 +0000 |
| Subject: | note 62456 deleted from function.sleep by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151873@lists.php.net to get a copy of this message | ||
Note Submitter: arielCo
----
The sleep(3) *nix manpage reads:
DESCRIPTION
sleep() makes the current process sleep until [seconds]
seconds have elapsed or a signal arrives which is not
ignored.
So, ANY incoming signal that has not been set with pcntl_signal() to SIG_IGN causes sleep() to
return.
If you don't want this, maybe
<?php
time_sleep_until(microtime(true) + $secs );
?>
will work, depending on CPU load.
RETURN VALUE
Zero if the requested time has elapsed, or the number of
seconds left to sleep.
The return value is an integer, and (at least in 5.1.2) it is the round()ed remaining time.