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

yipeiwu_com6年前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 5.3.x 的strtotime() 时区设定 警告信息修复

PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *...

PHP 观察者模式的实现代码

代码如下所示:复制代码 代码如下://被察者抽象类class Observed implements SplSubject{    protected $_...

使用 eAccelerator加速PHP代码的目的

使用 eAccelerator加速PHP代码  eAccelerator 真是一个好东西(它的前身是truck-mmcache)。  简单来讲它是...

php实现快速对二维数组某一列进行组装的方法小结

本文实例总结了php实现快速对二维数组某一列进行组装的方法。分享给大家供大家参考,具体如下: 问题: 比如我二维数组是这样的: $user = array( '0'=> ar...

基于PHP对XML的操作详解

<?php      $xml = simplexml_load_file('example.xml');  &nbs...