diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-16 17:07:20 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-16 17:07:20 +0000 |
commit | 91f02c167d3c11fb2426692750c225f29df22508 (patch) | |
tree | fd4eda321e665f7129c1f421918e6b864e86ab29 /ext/Time | |
parent | a5b1c163d928df548cbec60aa22830af0e4968d3 (diff) | |
download | perl-91f02c167d3c11fb2426692750c225f29df22508.tar.gz |
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
Diffstat (limited to 'ext/Time')
-rw-r--r-- | ext/Time/HiRes/HiRes.t | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/Time/HiRes/HiRes.t b/ext/Time/HiRes/HiRes.t index f92cb65c06..a2cb20649b 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"; |