From: Stephane Payrard Date: Mon, 24 Jan 2000 16:15:38 +0000 (+0100) Subject: avoid division by 0 in Benchmark.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ac4a978d1dfb6f1f4abe73e0845e644769e4a6e;p=p5sagit%2Fp5-mst-13.2.git avoid division by 0 in Benchmark.pm To: Gurusamy Sarathy Cc: perl5-porters@perl.org Message-ID: <20000124161538.A995@freesurf.fr> p4raw-id: //depot/cfgperl@4880 --- diff --git a/lib/Benchmark.pm b/lib/Benchmark.pm index 487ddd5..7cb78eb 100644 --- a/lib/Benchmark.pm +++ b/lib/Benchmark.pm @@ -435,7 +435,7 @@ sub timestr { $r,$pu,$ps,$pt) if $style eq 'noc'; $s=sprintf("%2d wallclock secs (%$f cusr + %$f csys = %$f CPU)", $r,$cu,$cs,$ct) if $style eq 'nop'; - $s .= sprintf(" @ %$f/s (n=$n)", $n / ( $pu + $ps )) if $n; + $s .= sprintf(" @ %$f/s (n=$n)", $n / ( $pu + $ps )) if $pu + $ps; $s; }