From: Rafael Garcia-Suarez Date: Fri, 9 Apr 2004 06:58:51 +0000 (+0000) Subject: Upgrade to Time::HiRes 1.59. X-Git-Tag: accepted/trunk/20130322.191538~22091 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8cb5b61aca0f046a25f18b65c461c04a886361a;p=platform%2Fupstream%2Fperl.git Upgrade to Time::HiRes 1.59. p4raw-id: //depot/perl@22680 --- diff --git a/ext/Time/HiRes/Changes b/ext/Time/HiRes/Changes index 33194b7..7b64ee1 100644 --- a/ext/Time/HiRes/Changes +++ b/ext/Time/HiRes/Changes @@ -1,8 +1,17 @@ Revision history for Perl extension Time::HiRes. +1.59 + - Change the Win32 recalibration limit to 0.5 seconds and tweak + the documentation to blather less about the gory details of the + Win32 implementation and more about the complications in general + of meddling with the system clock. + +1.58 + - Document the 1.57 change better. + 1.57 - - Window/Cygwin: if the performance counter drifts by more than - two seconds from the system clock (due to ntp adjustments, + - Win32/Cygwin/MinGW: if the performance counter drifts by more + than two seconds from the system clock (due to ntp adjustments, for example), recalibrate our internal counter: from Jan Dubois, based on [cpan #5933] by Jerry D. Hedden. diff --git a/ext/Time/HiRes/HiRes.pm b/ext/Time/HiRes/HiRes.pm index b6c8747..98d3142 100644 --- a/ext/Time/HiRes/HiRes.pm +++ b/ext/Time/HiRes/HiRes.pm @@ -15,7 +15,7 @@ require DynaLoader; d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer d_nanosleep); -$VERSION = '1.57'; +$VERSION = '1.59'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -329,8 +329,16 @@ become negative just became negative. Maybe your compiler is broken? =head1 CAVEATS Notice that the core C maybe rounding rather than truncating. -What this means is that the core C may be reporting the time as one second -later than C and C. +What this means is that the core C may be reporting the time +as one second later than C and C. + +Adjusting the system clock (either manually or by services like ntp) +may cause problems, especially for long running programs that assume +a monotonously increasing time (note that all platforms do not adjust +time as gracefully as UNIX ntp does). For example in Win32 (and derived +platforms like Cygwin and MinGW) the Time::HiRes::time() may temporarily +drift off from the system clock (and the original time()) by up to 0.5 +seconds. Time::HiRes will notice this eventually and recalibrate. =head1 AUTHORS diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs index fb516cd..3505bf4 100644 --- a/ext/Time/HiRes/HiRes.xs +++ b/ext/Time/HiRes/HiRes.xs @@ -181,11 +181,11 @@ START_MY_CXT #undef gettimeofday #define gettimeofday(tp, not_used) _gettimeofday(aTHX_ tp, not_used) -/* If the performance counter delta drifts more than 2 seconds from the - * system time then we recalibrate to system time. This means we may +/* If the performance counter delta drifts more than 0.5 seconds from the + * system time then we recalibrate to the system time. This means we may * move *backwards* in time! */ -#define MAX_DIFF Const64(20000000) +#define MAX_DIFF Const64(5000000) static int _gettimeofday(pTHX_ struct timeval *tp, void *not_used)