On Wed, 12 Apr 2023 at 11:01, Herbert Groot Jebbink <
herb...@groot.jebbink.nl> wrote:

>
> I'm in the process of using hrtime(true) instead of microtime(true), for
> this it would be great if REQUEST_TIME_HR would also exist next to
> REQUEST_TIME and REQUEST_TIME_FLOAT



Hi :)

The idea sounds reasonable on the face of it.

Are there any performance issues calling hrtime on every request (possibly
platform-specific)?

I note that the existing values are not fetched directly from a time
source, but have some logic for SAPIs to provide a value [1] e.g. from the
Apache request context [2], and then REQUEST_TIME is just
REQUEST_TIME_FLOAT truncated to integer.

Should the same approach happen here? e.g. should all three values be based
on hrtime if the SAPI does not provide a value? Would we even need an extra
value if REQUEST_TIME_FLOAT had enough precision?

[1] https://heap.space/xref/php-src/main/SAPI.c?r=9d5f2f13#1085
[2]
https://heap.space/xref/php-src/sapi/apache2handler/sapi_apache2.c?r=4da0da7f#371

Regards,
-- 
Rowan Tommins
[IMSoP]

Reply via email to