计算php程序的执行时间

需要以下三步:

<?php 
$stime=microtime(true); //获取程序开始执行的时间 
echo "hello world";         //你执行的代码 
$etime=microtime(true);//获取程序执行结束的时间$total=$etime-$stime;   //计算差值 
echo "<br />{$total} times"; 
?> 

猜你喜欢

转载自xiaolinlin0326.iteye.com/blog/2249910