RE: High resolution timer function
| From: | Anatol Belski | Date: | Tue, 02 Jan 2018 10:43:10 +0000 |
| Subject: | RE: High resolution timer function | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-101478@lists.php.net to get a copy of this message | ||
Hi,
> -----Original Message-----
> From: Anatol Belski [mailto:weltling@outlook.de] On Behalf Of Anatol Belski
> Sent: Saturday, December 16, 2017 3:03 PM
> To: internals@lists.php.net
> Cc: Niklas Keller <me@kelunik.com>
> Subject: [PHP-DEV] High resolution timer function
>
> Hi,
>
> I would like to propose a function for high resolution monotonic timing. There
> was discussions about this before and a PR
> https://github.com/php/php-
> src/pull/2368 which has issues and was abandoned. I've filed
> https://github.com/php/php-src/pull/2976 with some reworked
> implementation.
>
> A monotonic timer can be usable in several situations besides benchmarking.
> Having a simple functionality like this in the core should be a useful addition. The
> current approach is a function returning array of [seconds, nanoseconds] and
> optionally returning full nanosecond number as int on 64-bit or float on 32-bit.
> The first way is the most portable. Quite a few platforms are already supported
> by the current implementation.
>
> IMHO it should be fine to have a function like this in the core, perhaps also a few
> helper functions could be useful, too. I would like to pursue 7.3 with this. Please
> lets check for any concerns in general or with implementation, naming, etc.
>
If there are no further comments or objection, I would like to merge this patch anytime soon and see
to add a couple of helper functions for diff/compare.
Regards
Anatol