PHP检测每一段代码执行时间

$t1 = microtime(true);
sleep(3);
$t2 = microtime(true);
echo '程序耗时'.round($t2-$t1,3).'秒';

 

posted @ 2018-11-09 17:56  hjr_rong  阅读(332)  评论(0编辑  收藏  举报