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.
d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
d_nanosleep);
-$VERSION = '1.57';
+$VERSION = '1.59';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
=head1 CAVEATS
Notice that the core C<time()> maybe rounding rather than truncating.
-What this means is that the core C<time()> may be reporting the time as one second
-later than C<gettimeofday()> and C<Time::HiRes::time()>.
+What this means is that the core C<time()> may be reporting the time
+as one second later than C<gettimeofday()> and C<Time::HiRes::time()>.
+
+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
#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)