当前位置:首页 > PHP教程 > PHP高级教程

如何用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} ]秒";
?>


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!