summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Coburn <btcoburn@silicodon.net>2006-03-24 04:24:26 +0100
committerBen Coburn <btcoburn@silicodon.net>2006-03-24 04:24:26 +0100
commita609a9cc3002627e7527161f5bd8883b3bd0633d (patch)
treeeee30fc30d85576f5478810c68c5e5f8019c8748
parent0e99f6d7194833f1a152c286a984baca203b25ef (diff)
downloadrpg-a609a9cc3002627e7527161f5bd8883b3bd0633d.tar.gz
rpg-a609a9cc3002627e7527161f5bd8883b3bd0633d.tar.bz2
show page generation time
darcs-hash:20060324032426-05dcb-cca609254cfef5b583510b86904f1656dea98fc7.gz
-rw-r--r--inc/init.php7
-rw-r--r--lib/tpl/default/footer.html7
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>