summaryrefslogtreecommitdiff
path: root/lib/Benchmark.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2002-05-13 22:47:38 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-13 23:04:00 +0000
commitab43e786dcd7c253fc4b61a6e15b36c18bb20fa3 (patch)
treed48905065ef850a8d5978d86863b5138cea6808e /lib/Benchmark.t
parent3f2394f296786314979c2ad3096f123eb7b22930 (diff)
downloadperl-ab43e786dcd7c253fc4b61a6e15b36c18bb20fa3.tar.gz
Re: FreeBSD mostly OK. [nwc10@colon.colondot.net: Report /export/home/nwc10/Even-Smoke/Smoke]
Message-ID: <20020513204738.GD310@Bagpuss.unfortu.net> p4raw-id: //depot/perl@16583
Diffstat (limited to 'lib/Benchmark.t')
-rw-r--r--lib/Benchmark.t12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Benchmark.t b/lib/Benchmark.t
index a12ae6ed28..d7533c3d97 100644
--- a/lib/Benchmark.t
+++ b/lib/Benchmark.t
@@ -12,7 +12,7 @@ use Test::More tests => 159;
use Benchmark qw(:all);
-my $delta = 0.3;
+my $delta = 0.4;
# Some timing ballast
sub fib {
@@ -69,9 +69,13 @@ my $in_onesec = $onesec->iters;
print "# $in_onesec iterations\n";
ok ($in_onesec > 0, "iters returned positive iterations");
-my $difference = $in_onesec - $estimate;
-ok (abs ($difference / $in_onesec) < $delta,
- "is $in_onesec within $delta of estimate ($estimate)");
+{
+ my $difference = $in_onesec - $estimate;
+ my $actual = abs ($difference / $in_onesec);
+ ok ($actual < $delta, "is $in_onesec within $delta of estimate ($estimate)");
+ print "# $in_onesec is between " . ($delta / 2) .
+ " and $delta of estimate. Not that safe.\n" if $actual > $delta/2;
+}
# I found that the eval'ed version was 3 times faster than the coderef.
# (now it has a different ballast value)