diff options
-rw-r--r-- | inc/init.php | 7 | ||||
-rw-r--r-- | lib/tpl/default/footer.html | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/inc/init.php b/inc/init.php index ab7cab3b8..ab986b0d2 100644 --- a/inc/init.php +++ b/inc/init.php @@ -3,6 +3,13 @@ * Initialize some defaults needed for DokuWiki */ + // start timing Dokuwiki execution + function delta_time($start=0) { + list($usec, $sec) = explode(" ", microtime()); + return ((float)$usec+(float)$sec)-((float)$start); + } + define('DOKU_START_TIME', delta_time()); + // define the include path if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../').'/'); diff --git a/lib/tpl/default/footer.html b/lib/tpl/default/footer.html index 6d146c540..a3270d17a 100644 --- a/lib/tpl/default/footer.html +++ b/lib/tpl/default/footer.html @@ -55,4 +55,11 @@ $tgt = ($conf['target']['extern']) ? 'target="'.$conf['target']['extern'].'"' : </rdf:RDF> --> + +<?php +if ($conf['allowdebug']) { + echo '<!-- page made in '.round(delta_time(DOKU_START_TIME), 3).' seconds -->'; +} +?> + </div> |