note 71839 modified in function.time-nanosleep by googleguy
| From: | googleguy@php.net | Date: | Sat, 22 Dec 2012 23:03:33 +0000 |
| Subject: | note 71839 modified in function.time-nanosleep by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192655@lists.php.net to get a copy of this message | ||
Just glancing at this - and the note from over a year ago with a implementation for windows.. with
5.0.0 and higher it would be simplier to just do something like......
<?php
if (!function_exists('time_nanosleep')) {
function time_nanosleep($seconds, $nanoseconds) {
sleep($seconds);
usleep(round($nanoseconds/100));
return true;
}
}
?>
....off the top of my head - obviously simple enough there should be no mistakes.. but those are the
ones that always seem to get ya :( .....
--was--
Just glancing at this - and the note from over a year ago with a implementation for windows.. with
5.0.0 and higher it would be simplier to just do something like......
<?
if (!function_exists('time_nanosleep')) {
function time_nanosleep($seconds, $nanoseconds) {
sleep($seconds);
usleep(round($nanoseconds/100));
return true;
}
}
?>
....off the top of my head - obviously simple enough there should be no mistakes.. but those are the
ones that always seem to get ya :( .....
http://php.net/manual/en/function.time-nanosleep.php