note 113078 added to function.microtime
| From: | DanielRhodes | Date: | Tue, 27 Aug 2013 12:54:41 +0000 |
| Subject: | note 113078 added to function.microtime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-196093@lists.php.net to get a copy of this message | ||
But note that the default 'precision' setting of PHP* - which is used when a float is
converted to a stringy format by echo()ing, casting or json_encode()ing etc - is not enough to hold
the six digit accuracy of microtime(true).
Out of the box, microtime(true) will echo something like:
1377611450.1234
Which is obviously less than microsecond accuracy. You'll probably want to bump the
'precision' setting up to 16 which will echo something like:
1377611450.123456
*Internally* it will be accurate to the six digits even with the default 'precision', but
a lot of things (ie. NoSQL databases) are moving to all-text representations these days so it
becomes a bit more important.
* 14 at the time of writing
----
Server IP: 69.147.83.199
Probable Submitter: 141.0.48.3
----
Manual Page -- http://php.net/manual/en/function.microtime.php
Edit -- https://master.php.net/note/edit/113078
Del: integrated -- https://master.php.net/note/delete/113078/integrated
Del: useless -- https://master.php.net/note/delete/113078/useless
Del: bad code -- https://master.php.net/note/delete/113078/bad+code
Del: spam -- https://master.php.net/note/delete/113078/spam
Del: non-english -- https://master.php.net/note/delete/113078/non-english
Del: in docs -- https://master.php.net/note/delete/113078/in+docs
Del: other reasons-- https://master.php.net/note/delete/113078
Reject -- https://master.php.net/note/reject/113078
Search -- https://master.php.net/manage/user-notes.php