[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Bug in the Benchmark module
Hi,
I often use the Benchmark module to time programs and I
found that on my system (linux 2.0.36 on X86 with perl
5.005-03) the total CPU time is not displayed properly when
selecting the 'all' or default option.
I downloaded the latest dev version of perl 5.005_63 to
check if it had been updated and it does the same.
I found in the timestr function the following :
$s=sprintf("%2d wallclock secs (%$f usr %$f sys + %$f cusr
%$f csys = %$f CPU)",
@t,$t) if $style eq 'all';
On my system, @t has one more element that is always equal
to 0 therefore CPU = 0.
Also, having @t and $t is pretty much confusing.
I changed to the following :
my($pt, $ct, $tt) = ($tr->cpu_p, $tr->cpu_c, $tr->cpu_a);
and
$s=sprintf("%2d wallclock secs (%$f usr %$f sys + %$f cusr
%$f csys = %$f CPU)",
$r,$pu,$ps,$cu,$cs,$tt) if $style eq 'all';
and it works fine.
Thanks for the good work guys and I hope this email helps.
Cedric.
--
---------------------------------------------------------
Cedric Auzanne Ingenieur de l'ESIAL, Nancy, France
Email : cedric.auzanne@nist.gov
Phone : 301/975-2945
Fax : 301/670-0939
www : http://www.nist.gov/speech
National Institute of Standards and Technology
Gaithersburg, Maryland 20899, USA
---------------------------------------------------------
To do is to be - Sartre
To be is to do - Shakespeare
Do be do be do - Sinatra
Scoo be do be dooo - Scooby-Doo
---------------------------------------------------------
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]