网站建设

php获取程序执行的时间

php获取程序执行的时间进的代码分享。

在head.htm中加入,也就是在默认模版中添加“$stime=microtime(true); //获取程序开始执行的时间”

<!–<?php  
  1. $stime=microtime(true); //获取程序开始执行的时间  
  2. $GuideFid[$fid]=str_replace(“<a href=‘$webdb[www_url]’ class=‘guide_menu’>>首页</a>“,””,$GuideFid[$fid]);  
  3. $fupId=intval($fupId);  
  4. $topMenu[$fupId]=’ck’;  
  5. print <<<EOT  
  6. >  

这里是网页
再在foot.htm修改如:

<!–  
  1. EOT;  
  2. $etime=microtime(true);//获取程序执行结束的时间  
  3. $total=$etime$stime;   //计算差值  
  4. echo “<br />[页面执行时间:{$total} ]秒”;  
  5. ?>  

Related Articles

发表回复

Back to top button