6 * Description: Shows the time that was needed to render the current page
8 * Author: Michael Vvogel <http://pirati.ca/profile/heluecht>
12 function rendertime_install() {
13 register_hook('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end');
17 function rendertime_uninstall() {
18 unregister_hook('init_1', 'addon/rendertime/rendertime.php', 'rendertime_init_1');
19 unregister_hook('page_end', 'addon/rendertime/rendertime.php', 'rendertime_page_end');
22 function rendertime_init_1(&$a) {
25 function rendertime_page_end(&$a, &$o) {
27 $duration = round(microtime(true)-$a->performance["start"], 3);
29 $o = $o.'<div class="renderinfo">'.sprintf(t("Rendertime: Database: %s, Network: %s, Rendering: %s, Total: %s"),
30 round($a->performance["database"], 3),
31 round($a->performance["network"], 3),
32 round($a->performance["rendering"], 3),