您的位置:首页 > 编程语言 > PHP开发

php获取程序执行的时间

2013-09-07 09:37 495 查看
php获取程序执行的时间进的代码分享。

在head.htm中加入,也就是在默认模版中添加“$stime=microtime(true); //获取程序开始执行的时间”
<!--<?php
$stime=microtime(true); //获取程序开始执行的时间
$GuideFid[$fid]=str_replace("<a href='$webdb[www_url]' class='guide_menu'>>首页</a>","",$GuideFid[$fid]);
$fupId=intval($fupId);
$topMenu[$fupId]='ck';
print <<<EOT
-->


这里是网页

再在foot.htm修改如:
<!--
EOT;
$etime=microtime(true);//获取程序执行结束的时间
$total=$etime-$stime;   //计算差值
echo "<br />[页面执行时间:{$total} ]秒";
?>

参考文档:
PHP计算页面执行时间的代码举例

php计算当前页面执行时间的例子


PHP页面运行时间计时类



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  程序执行的时间