From 91f02c167d3c11fb2426692750c225f29df22508 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Tue, 16 Oct 2001 17:07:20 +0000 Subject: [PATCH] Can't expect too much accuracy from a sleep of one second. (I think this will also fail with high load.) p4raw-id: //depot/perl@12458 --- ext/Time/HiRes/HiRes.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ext/Time/HiRes/HiRes.t b/ext/Time/HiRes/HiRes.t index f92cb65..a2cb206 100644 --- a/ext/Time/HiRes/HiRes.t +++ b/ext/Time/HiRes/HiRes.t @@ -223,7 +223,9 @@ unless (defined &Time::HiRes::setitimer $SIG{VTALRM} = 'DEFAULT'; } -print abs(sleep(1) - 1) < 0.001 ? "ok 20\n" : "not ok 20\n"; +$a = abs(sleep(1) - 1); +print $a < 0.1 ? "ok 20 # $a\n" : "not ok 20 # $a\n"; -print abs(usleep(1000000) / 1000000 - 1) < 0.001 ? "ok 21\n" : "not ok 21\n"; +$a = abs(usleep(1000000) / 1000000 - 1); +print $a < 0.1 ? "ok 21 # $a\n" : "not ok 21 # $a\n"; -- 2.7.4