[pmwiki-users] Strange output on bottom page of pmwiki.org

Patrick R. Michaud pmichaud at pobox.com
Tue Apr 17 09:01:14 CDT 2007


On Tue, Apr 17, 2007 at 03:20:03PM +0200, SMETS Stephane     BKS-IT wrote:
>    I see this sometime on pmwiki org
> 
>    [beg]
>    Edit -  History -  Print -  Recent Changes -  Search
>    Page last modified on April 13, 2007, at 01:22 PM
>    00.00 00.00 config start
>    00.00 00.00 config end
>    00.08 00.07 MarkupToHTML begin
>    ...
>    00.27 00.25 MarkupToHTML end
>    00.40 00.26 now
>    [end]
> 
>    I can imagine it is to debug code, but can we use this also 
>    on our famrs?

It's a profiling/logging feature, so that I can see how long
individual operations are taking to execute and to provide some
debugging output.

To enable the stopwatch, use:

    $EnableDiag = 1;
    $EnableStopWatch = 1;
    $HTMLFooterFmt['stopwatch'] = 'function:StopWatchHTML 1';

To add an entry to the stopwatch log (e.g., from a custom
recipe or function), it's just

    StopWatch('function_name message');

The first call to StopWatch() is always considered to be time "zero" 
-- all other times are relative to that.  Setting $EnableStopWatch
to 1 will display the wall-clock time; systems that support PHP's
getrusage() function (typically Unix/Linux) can set $EnableStopWatch
to 2 to get the wall-clock time and the CPU time.

Pm



More information about the pmwiki-users mailing list