note 53948 added to function.microtime
| From: | rsalazar at innox dot com dot mx | Date: | Fri, 17 Jun 2005 22:20:28 +0000 |
| Subject: | note 53948 added to function.microtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90607@lists.php.net to get a copy of this message | ||
Yet another way to achieve the same effect without the loss of decimals is with the PCRE replace
function (preg_replace), which also seems to be a _bit_ faster (about 2.5E-05 sec):
<?php
$float_time = preg_replace('/^0?(\S+) (\S+)$/X', '$2$1', microtime());
?>
PS unluckypixie, "james at gogo dot co dot nz" wrote the same at Dec/2004
----
Manual Page -- http://www.php.net/manual/en/function.microtime.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53948
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53948&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53948&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53948&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53948&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+53948&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53948&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53948&report=yes
Search -- http://master.php.net/manage/user-notes.php