a616652325 发表于 2017-4-6 11:04:38

php 页面执行时间计算代码

  <? 
$pagestartime=microtime(); 
?> 
<!--网页内容 start--> 
网页内容 
... 
... 
<!--网页内容 end--> 
<? 
$pageendtime = microtime(); 
$starttime = explode(" ",$pagestartime); 
$endtime = explode(" ",$pageendtime); 
$totaltime = $endtime-$starttime+$endtime-$starttime; 
$timecost = sprintf("%s",$totaltime); 
echo "页面运行时间: $timecost 秒"; 
?> 
页: [1]
查看完整版本: php 页面执行时间计算代码