Last active
July 9, 2017 16:31
-
-
Save jenstornell/c4990a30eedd1dd69e6a to your computer and use it in GitHub Desktop.
Plugin for Kirby Panel Bar - It calculates the loading time of the current page. PHP 5.4 and above required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
1. Place the file as /site/plugins/panel-bar-loading-time/panel-bar-loading-time.php | |
2. Add it to the items array of the panel-bar like this: | |
'time' => panelbar__loadingTime(), | |
*/ | |
function panelbar__loadingTime() { | |
$time = number_format( ( microtime( true ) - $_SERVER['REQUEST_TIME_FLOAT'] ), 2 ); | |
$time_item = panelbar::link(array( | |
'id' => 'time', | |
'icon' => 'clock-o', | |
'url' => '#', | |
'label' => $time, | |
'mobile' => 'text', | |
)); | |
return $time_item; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With new label element: https://gist.github.com/distantnative/cf42039a770d7fed787c