当前位置: 移动技术网 > IT编程>开发语言>PHP > 如何用php获取程序执行的时间

如何用php获取程序执行的时间

2019年04月09日  | 移动技术网IT编程  | 我要评论
在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} ]秒";
?>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网