当前位置:编程学习 > php >>

计算页面执行时间

计算页面执行时间
在PHP网页的开头加入以下
<?
$time_start = getmicrotime();
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
?>
然后到最后加入以下代码
<?
$time_end = getmicrotime();
printf ("[页面执行时间: %.2f毫秒] ",($time_end - $time_start)*1000);
?>

补充:Php教程,Php应用 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,