RE: [PHP-DEV] Fwd: Monotonic Time
| From: | Anatol Belski | Date: | Fri, 06 Jan 2017 18:58:02 +0000 |
| Subject: | RE: [PHP-DEV] Fwd: Monotonic Time | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97541@lists.php.net to get a copy of this message | ||
Hi,
> -----Original Message-----
> From: Niklas Keller [mailto:me@kelunik.com]
> Sent: Thursday, January 5, 2017 2:27 AM
> To: Michael Wallner <mike@php.net>; Anatol Belski <anatol.php@belski.net>
> Cc: PHP Internals <internals@lists.php.net>
> Subject: Re: [PHP-DEV] Fwd: Monotonic Time
>
> >
> > Actually, it seems, that hrtime doesn't let you access the current
> > value, which is, well, quite a major use case, isn't it?
>
>
> Yes, that seemed weird to me, too. Did we miss anything, Anatol?
>
Yeah, I thought I did that already, but well ... The ext was more about performance testing, at the
start at least. I made some refactoring to it yesterday, so it is now possible to implement an
arbitrary userspace timer using the HRTime\PerformanceCounter class. Maybe should add also
HRTime\Timer, but it should first get a thought about some good API approach.
The portable parts are bundled files timer.[h|c] in the hrtime repo, supporting POSIX, Windows and
Mac. They can be reused, or taken as an example, for sure.
Regards
Anatol