From: Steve Peters Date: Sun, 10 Feb 2008 05:05:28 +0000 (+0000) Subject: Upgrade to Time-HiRes-1.9712 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=806b8cc26f53c79876b70a2e4d874e2086fceac7;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Time-HiRes-1.9712 p4raw-id: //depot/perl@33266 --- diff --git a/ext/Time/HiRes/HiRes.pm b/ext/Time/HiRes/HiRes.pm index 307ad94..ce7b336 100644 --- a/ext/Time/HiRes/HiRes.pm +++ b/ext/Time/HiRes/HiRes.pm @@ -23,7 +23,7 @@ require DynaLoader; stat ); -$VERSION = '1.9711'; +$VERSION = '1.9712'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/ext/Time/HiRes/Makefile.PL b/ext/Time/HiRes/Makefile.PL index a332e4b..28ca521 100644 --- a/ext/Time/HiRes/Makefile.PL +++ b/ext/Time/HiRes/Makefile.PL @@ -851,19 +851,20 @@ sub main { print < 4*$limit) { - my $ratio = abs($ival/$exp); - $not = "tick: $exp sleep took $ival ratio $ratio"; - $i = 0; - } - } - POSIX::sigaction(&POSIX::SIGALRM, POSIX::SigAction->new("tick"), $oldaction) @@ -315,7 +302,7 @@ unless ( defined &Time::HiRes::gettimeofday } my $exp = 0.3 * (5 - $i); # This test is more sensitive, so impose a softer limit. - if (abs($ival/$exp - 1) > 3*$limit) { + if (abs($ival/$exp - 1) > 4*$limit) { my $ratio = abs($ival/$exp); $not = "while: $exp sleep took $ival ratio $ratio"; last; @@ -324,6 +311,19 @@ unless ( defined &Time::HiRes::gettimeofday } } + sub tick { + $i--; + my $ival = Time::HiRes::tv_interval ($r); + print "# Tick! $i $ival\n"; + my $exp = 0.3 * (5 - $i); + # This test is more sensitive, so impose a softer limit. + if (abs($ival/$exp - 1) > 4*$limit) { + my $ratio = abs($ival/$exp); + $not = "tick: $exp sleep took $ival ratio $ratio"; + $i = 0; + } + } + if ($use_sigaction) { POSIX::sigaction(&POSIX::SIGALRM, $oldaction); } else {