diff options
author | John P. Linderman <jpl@research.att.com> | 2001-08-31 04:20:35 -0400 |
---|---|---|
committer | Artur Bergman <sky@nanisky.com> | 2001-08-31 11:28:17 +0000 |
commit | 64cc9c1c32ff80fa565521ead90346f994c3e770 (patch) | |
tree | e534e9b54bb4f87074d21771333d1b3984df95b9 /ext/Time | |
parent | ae80fb0305317cb80a840031917a144cc9dfaf25 (diff) | |
download | perl-64cc9c1c32ff80fa565521ead90346f994c3e770.tar.gz |
Re: Problem in ext/Time/HiRest/HiRes.t
Message-Id: <200108311220.IAA54125@raptor.research.att.com>
Fixes test 14 which could fail randomly in rare cases.
p4raw-id: //depot/perl@11797
Diffstat (limited to 'ext/Time')
-rw-r--r-- | ext/Time/HiRes/HiRes.t | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ext/Time/HiRes/HiRes.t b/ext/Time/HiRes/HiRes.t index 95f1a0814d..be462e6ec1 100644 --- a/ext/Time/HiRes/HiRes.t +++ b/ext/Time/HiRes/HiRes.t @@ -133,10 +133,16 @@ else { if (!$have_time) { skip 14 } else { - my $t = time(); - my $tf = Time::HiRes::time(); - ok 14, (abs($tf - $t) <= 1), - "time $t differs from Time::HiRes::time $tf"; + my ($t1, $tf, $t2); + for my $i (1 .. 9) { + $t1 = time(); + $tf = Time::HiRes::time(); + $t2 = 1 + time(); + last if (($t2 - $t1) <= 1); + } + ok 14, (($t1 <= $tf) && ($tf <= $t2)), + "Time::HiRes::time $tf not bracketed by $t1 - $t2"; + } unless (defined &Time::HiRes::gettimeofday |