简体   繁体   中英

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

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

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

我建议使用barryvdh/laravel-debugbar软件包,该软件包可以为您提供有关请求的大量信息,包括执行的查询,各种加载时间等等。

您可以使用以下软件包之一进行调试: barryvdh / laravel-debugbarsebklaus / profiler

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM