Log Laravel execution time to console


Put this in app/start/global.php to get Laravels execution time to the browser console log.

L4

$start = microtime(true);

App::finish(function() use ($start) {
echo "<script>console.log('App finish: ".round((microtime(true) - $start) * 1000, 3)." ms')</script>";
});
PHP

This works with L5:

This page took {{ (microtime(true) - LARAVEL_START) }} seconds to render
Blade

Leave a Reply

Your email address will not be published. Required fields are marked *