From: Jarkko Hietaniemi Date: Mon, 22 Oct 2001 21:31:31 +0000 (+0000) Subject: Cygwin seems to round up (or closest, but not down) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cb11fff93f78facdc8f5c177e1ef8e2dd23467e8;p=p5sagit%2Fp5-mst-13.2.git Cygwin seems to round up (or closest, but not down) for time(), so half of the time (bad pun intended) Time::HiRes::time() is less than time(), half of the time it's more. So let's try harder in the loop. p4raw-id: //depot/perl@12595 --- diff --git a/ext/Time/HiRes/HiRes.t b/ext/Time/HiRes/HiRes.t index e0f0cf7..fbf6a3f 100644 --- a/ext/Time/HiRes/HiRes.t +++ b/ext/Time/HiRes/HiRes.t @@ -134,14 +134,14 @@ if (!$have_time) { skip 14 } else { my ($t1, $tf, $t2); - for my $i (1 .. 9) { + for my $i (1 .. 20) { $t1 = time(); $tf = Time::HiRes::time(); $t2 = 1 + time(); - last if (($t2 - $t1) <= 1); + last if (($t2 - $t1) <= 1) && $t1 <= $tf; } ok 14, (($t1 <= $tf) && ($tf <= $t2)), - "Time::HiRes::time $tf not bracketed by $t1 - $t2"; + "Time::HiRes::time $tf not bracketed by [$t1, $t2]"; }