Average timing calculation in CPW perftracker

Hi,

I spotted the following calculation in CPWs source code (cpw_perftracker.c), and I’m wondering if this is an accurate way of calculating the average time spent in a section:

if ( pmark->average == false )
    pmark->ticks = pmark->ticks + ( cpw_localhost_hpcount() - pmark->entered );
else
    pmark->ticks = ( pmark->ticks + ( cpw_localhost_hpcount() - pmark->entered ) ) * .5;

Shouldn’t the pmark->ticks be weighed according to the number of calls made to the section?

TIA

Jean-Marc.

Your right, it’s not accurate. It should be
averaging over all the calls. I worked up an
update which I’ll release to the site and
annouce here shortly. If you want the touchup
now mail me and i’ll send ya the source.
(cpw ‘at’ mathies . com)

Thanks for the feedback!

Regards,
Jim