note 73857 deleted from function.usleep by googleguy
| From: | googleguy@php.net | Date: | Tue, 15 Jan 2013 04:41:12 +0000 |
| Subject: | note 73857 deleted from function.usleep by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-193045@lists.php.net to get a copy of this message | ||
Note Submitter: Marius (mm at co-operation dot de)
----
My solution providing usleep on a windows based os:
// Helper function
function getmicrotime(){
list($usec, $sec) = explode(' ',microtime());
return ((float)$usec + (float)$sec);
}
// usleep alias function for windows
function msleep($micro_seconds=0) {
$stop = getmicrotime() + ($miliseconds / 1000);
while (getmicrotime() <= $stop) {
// loop
}
return true;
}