Re: Fwd: Monotonic Time
| From: | Michael Wallner | Date: | Wed, 04 Jan 2017 17:00:07 +0000 |
| Subject: | Re: Fwd: Monotonic Time | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97514@lists.php.net to get a copy of this message | ||
On 04/01/17 13:58, Niklas Keller wrote:
> Resending previous mail, because mail distribution was broken...
>
> Morning Internals,
>
> PHP doesn't currently have a way to access a monotonic time. There's a
> feature request in the bug tracker: bugs [dot] php [dot]
> net/bug.php?id=68029
>
> A monotonic time is required to measure time intervals correctly, e.g. for
> implementing event loops based on stream_select. microtime() is affected by
> NTP and leap seconds and can therefore not be reliably used for measuring
> time intervals.
>
..
> There's an existing PECL extension named hrtime: php [dot]
> net/manual/en/book.hrtime.php
>
> I think we can reuse parts of it to implement a function in core to access
> a monotonic time, I don't think we need to merge the extension into core.
>
> What do you think about adding such a function to the PHP core?
+1?
Actually, it seems, that hrtime doesn't let you access the current
value, which is, well, quite a major use case, isn't it?
--
Regards,
Mike
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc