Revision history for Perl extension Time::HiRes.
+1.78 [2005-10-03]
+ - ITIMER_VIRTUAL detection in HiRes.t had problems (that we cannot
+ in the general case fail already at 'use' is suboptimal)
+ - fixes to the documentation of clock_gettime() and clock_getres()
+
1.77 [2005-10-03]
- add support for the POSIX clock_gettime() and clock_getres(),
if available, either as library calls or as syscalls
d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
d_nanosleep d_clock_gettime d_clock_getres);
-$VERSION = '1.77';
+$VERSION = '1.78';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
$SIG{VTALRM} = sub { print time, "\n" };
setitimer(ITIMER_VIRTUAL, 10, 2.5);
- # How accurate we can be, really?
-
- my $reso = clock_gettime(CLOCK_REALTIME);
+ use Time::HiRes qw( clock_gettime clock_getres CLOCK_REALTIME );
+ # Read the POSIX high resolution timer.
+ my $high = clock_getres(CLOCK_REALTIME);
+ # But how accurate we can be, really?
+ my $reso = clock_getres(CLOCK_REALTIME);
=head1 C API
drift off from the system clock (and the original time()) by up to 0.5
seconds. Time::HiRes will notice this eventually and recalibrate.
Note that since Time::HiRes 1.77 the clock_gettime(CLOCK_MONOTONIC)
-might help in this (in case your system supports it).
+might help in this (in case your system supports CLOCK_MONOTONIC).
=head1 SEE ALSO
unless ( defined &Time::HiRes::setitimer
&& defined &Time::HiRes::getitimer
- && exists &Time::HiRes::ITIMER_VIRTUAL
+ && eval 'use Time::HiRes qw(ITIMER_VIRTUAL); print ITIMER_VIRTUAL'
+ && $Config{d_select}
&& $Config{d_select}
&& $Config{sig_name} =~ m/\bVTALRM\b/) {
for (18..19) {