summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-04-09 06:58:51 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-04-09 06:58:51 +0000
commitd8cb5b61aca0f046a25f18b65c461c04a886361a (patch)
tree42785a945ea4b4a897fc096ba67fd06e51ab09d4 /ext
parent897ff129fe66a34d2316b4c99eea687601add373 (diff)
downloadperl-d8cb5b61aca0f046a25f18b65c461c04a886361a.tar.gz
Upgrade to Time::HiRes 1.59.
p4raw-id: //depot/perl@22680
Diffstat (limited to 'ext')
-rw-r--r--ext/Time/HiRes/Changes13
-rw-r--r--ext/Time/HiRes/HiRes.pm14
-rw-r--r--ext/Time/HiRes/HiRes.xs6
3 files changed, 25 insertions, 8 deletions
diff --git a/ext/Time/HiRes/Changes b/ext/Time/HiRes/Changes
index 33194b7754..7b64ee1a6c 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 b6c87474cf..98d314297b 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<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
diff --git a/ext/Time/HiRes/HiRes.xs b/ext/Time/HiRes/HiRes.xs
index fb516cd4d8..3505bf4a4e 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)