<?php
phpinfo();
/**
* Simple function to replicate PHP 5 behaviour
*/
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$time_start = microtime_float();
// Sleep for a while
usleep(100);
$time_end = microtime_float();
$time = $time_end - $time_start;
echo "exec time in $time seconds\n";
?>
能计算php脚本time
本文转自 liang3391 51CTO博客,原文链接:http://blog.51cto.com/liang3391/800105