📜  如何在 laravel 中查看运行时间 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:39.525000             🧑  作者: Mango

代码示例1
$timeStart = microtime(true);

App::finish(function() use ($timeStart) {
    $diff = microtime(true) - $timeStart;
    $sec = intval($diff);
    $micro = $diff - $sec;
    Log::debug(Request::getMethod() . "[" . Request::url() . "] Time: " . round($micro * 1000, 4) . " ms");
});