计算php 脚本运行时间

$t1 = microtime(true);
// ... 执行代码 ...
$t2 = microtime(true);
echo '耗时'.round($t2-$t1,3).'秒';

原文地址:https://www.cnblogs.com/Jerry-blog/p/5038910.html