ExecutionTimer

<< | Cookbook-V1 | >>

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


Goal

Satisify my curiosity regarding the execution time of the wiki scripts.

Solution

Attach:executionTimer.php

The Execution Timer add-on appends

 "Execution time: x.xxxxxx miliseconds"

to the bottom of your page. Just download into your local directory and add

 include_once( "local/executionTimer.php");

to your local.php.

Revision History

  • 4 Dec 2003 - Added

Contributors

  • Paul Williams

Comments.

Funny extra, I added it to my pages.

Script for 0.6.4+

 
<?php

function getmicrotime(){
        list($usec, $sec) = explode(" ",microtime());
        return ((float)$usec + (float)$sec);
}
$beginTime = getmicrotime();


function endTiming() {
        global $beginTime;
        $endTime = getmicrotime();
        printf( "&nbsp;Tijdsduur: %1.3f sec.", $endTime - $beginTime );
}
?>

  • Add the include statement to the begin of your config.php
  • Add <!--function:endTiming --> to (the end of) your .tmpl file, on the spot where you would like to have the time.

bram

pmwiki-2.3.38 -- Last modified by {{brbrbr}}?

from IP: 85.171.160.186 ip should be disabled by default for security reasons