note 69705 deleted from function.microtime by tularis
| From: | tularis@php.net | Date: | Sun, 22 Jun 2008 12:08:26 +0000 |
| Subject: | note 69705 deleted from function.microtime by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-140678@lists.php.net to get a copy of this message | ||
Note Submitter: a dot winkelbauer at gmx dot at
----
this is the function i use instead of microtime() with php < 5. it returns the whole time
(seconds and microseconds) as a string or as a float.
<?php
function myMicrotime($get_as_float = false)
{
list($msec, $sec) = explode(" ", microtime());
$time = $sec . substr($msec, 1);
return $as_float === false ? $time : (float)$time;
}
?>