如何检查我的exec()
脚本运行了多长时间?输出将是这样的:
1 Day(s) 2 hours 23 minutes 12 seconds
我不希望它像这样输出超过 60 秒
1 Day(s) 2 hours 23 minutes 118 seconds
我的代码:
$start = time();
$s = time() - $start;
$m = floor($s / 60);
$h = floor($m / 60);
$msg = "script running for approx: Seconds - $s | Minutes - $m | Hours - $h";
echo $msg;