note 83107 deleted from function.microtime by tularis
| From: | tularis@php.net | Date: | Sun, 22 Jun 2008 12:02:31 +0000 |
| Subject: | note 83107 deleted from function.microtime by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140656@lists.php.net to get a copy of this message | ||
Note Submitter: carbolymer at o2 dot pl
----
to: blue at ba7rain dot net
Instead of:
<?php
function GetMicro(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
?>
You can simply use:
<?php
microtime(true);
?>
Which gives the same effect. I don't know why that argument is not mentioned here.
Example:
<?php
$i = microtime(true);
sleep(1);
echo microtime(true)-$i;
/*
-- output --
0.99996805191
-- output --
*/
?>
Thanks to xk.