// VERY BEGIN OF SCRIPT
$_SERVER['HX_startTime'] = microtime(true);
...
// MY SHUTDOWN FUNCTION
register_shutdown_function('HX_shutdownFn');
function HX_shutdownFn()
{
// formatTimeSpan is simple time to string conversion function
var_dump(formatTimeSpan(microtime(true) - $_SERVER['HX_startTime']));
}
...
// VERY END OF SCRIPT
var_dump(formatTimeSpan(microtime(true) - $_SERVER['HX_startTime']));
我有0.0005s。在脚本和1.1s结束时。在关机功能。正常吗?1秒在哪里丢失?
脚本是纯php,不使用db连接等。在WAMP服务器上测试(php v 5.3.9,apache 2.2.21)