Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show render time / page load time in Laravel?

Tags:

php

laravel

I'm using Laravel and want to display render time / page load time in my web application. Can you help me?

like image 803
Miftah Afina Avatar asked Mar 25 '15 08:03

Miftah Afina


2 Answers

Laravel defines a LARAVEL_START constant which contains the microtime of when the framework started booting. You could use that to calculate the difference.

You can use the following

This page took {{ (microtime(true) - LARAVEL_START) }} seconds to render
like image 51
Wader Avatar answered Sep 20 '22 15:09

Wader


I would recommend barryvdh/laravel-debugbar package which can give you plenty of informations about request including executed queries, various load times and many more.

like image 35
Maksym Avatar answered Sep 20 '22 15:09

Maksym