Edit report at https://bugs.php.net/bug.php?id=77307&edit=1
ID: 77307
User updated by: bugzilla77 at gmail dot com
Reported by: bugzilla77 at gmail dot com
Summary: $_SERVER['REQUEST_HRTIME_INTEGER']
Status: Open
Type: Feature/Change Request
Package: Date/time related
Operating System: *
PHP Version: 7.3.0
Block user comment: N
Private report: N
New Comment:
What about
$_SERVER['PHP_HRTIME_INTEGER']
?
You would not have to encode
$start = hrtime(true);
in each script.
Previous Comments:
------------------------------------------------------------------------
[2018-12-17 12:38:58] spam2 at rhsoft dot net
http://php.net/manual/en/function.hrtime.php
how can "hrtime â Get the system's high resolution time" be computed?
https://elinux.org/High_Resolution_Timers
------------------------------------------------------------------------
[2018-12-17 12:26:36] bugzilla77 at gmail dot com
If $_SERVER['REQUEST_TIME_FLOAT'] is computed by php engine based on data from the server,
you can compute $_SERVER['REQUEST_HRTIME_INTEGER'] too.
------------------------------------------------------------------------
[2018-12-17 11:22:49] spam2 at rhsoft dot net
do you realize that this values are not from php at all but from the webserver?
it is not the script start but when the request arrived at the webserver, easily to see when you use
your own startup value at the begin of the application and so you can even measure how expensive php
initialization is
------------------------------------------------------------------------
[2018-12-17 10:57:32] bugzilla77 at gmail dot com
REQUEST_HRTIME_FLOAT -> REQUEST_HRTIME_INTEGER
------------------------------------------------------------------------
[2018-12-17 07:54:51] bugzilla77 at gmail dot com
Description:
------------
Please add to $_SERVER array:
key: REQUEST_HRTIME_FLOAT
value: hrtime(true)
Test script:
---------------
<?php
// PHP 7.2
// ... page
// ... code
$elapsed=$_SERVER['REQUEST_TIME_FLOAT']-microtime(true);
?>
<?php
// PHP 7.3
// ... page
// ... code
$elapsed=$_SERVER['REQUEST_HRTIME_FLOAT']-hrtime(true);
?>
Expected result:
----------------
$_SERVER['REQUEST_HRTIME_FLOAT'] returns hrtime(true) of script start
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77307&edit=1