How to display execution time in Laravel page?
淡淡烟草味
淡淡烟草味 2017-05-16 16:56:03
0
1
861

With laravel-debugbar installed, you can count the execution time of PHP+SQL, which is very useful. Now there is a requirement to display the execution time on each page. After searching, there is no ready-made solution.

How to call laravel-debugbar?

Laravel Debugbar

https://github.com/barryvdh/laravel-debugbar

This is a package to integrate PHP Debug Bar with Laravel 5. It includes a ServiceProvider to register the debugbar and attach it to the output. You can publish assets and configure it through Laravel. It bootstraps some Collectors to work with Laravel and implements a couple custom DataCollectors, specific for Laravel. It is configured to display Redirects and (jQuery) Ajax Requests. (Shown in a dropdown) Read the documentation for more configuration options.

淡淡烟草味
淡淡烟草味

reply all(1)
左手右手慢动作

Record start/end time

phpDebugbar::startMeasure('render','Time for rendering');
Debugbar::stopMeasure('render');
Debugbar::addMeasure('now', LARAVEL_START, microtime(true));
Debugbar::measure('My long operation', function() {
    //Do something..
});

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!