计算php程序的执行时间
需要以下三步:
<?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";
?>
暂无评论。
评论功能维护中,当前仅展示历史评论。