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