On Wed, 12 Apr 2023 at 11:53,  Rowan Tommins wrote:

> Should the same approach happen here? e.g. should all three
> values be based on hrtime

fallback for REQUEST_TIME and REQUEST_TIME_FLOAT to hrtime seems not
possible, hrtime is not based on the actual time, hrtime can be used to
calculate a duration or so, not to retrieve the actual time itself.

The reason that I want to migrate from microtime(true) to hrtime(true) is
described in the comment in the PHP manual for hrtime:

"This function is particularly necessary on VMs running on KVM, XEN
(openstack, AWS EC2, etc) when timing execution times.

On these platforms which lack vDSO the common method of using time() or
microtime() can dramatically increase CPU/execution time due to the context
switching from userland to kernel when running the `gettimeofday()` system
call."

This migration is almost done, except in the case when it is used together
with REQUEST_TIME_FLOAT, that's the trigger for this possible RFC. The
extra precision is a bonus, but in my use case not needed. (in fact I
remove it so that old code still works)

Reply via email to