Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 03462c6

Browse files
committed
Time-HiRes-1.9758_01
1 parent df4a80c commit 03462c6

File tree

19 files changed

+512
-181
lines changed

19 files changed

+512
-181
lines changed

Porting/Maintainers.pl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,10 +1480,12 @@ package Maintainers;
14801480
},
14811481

14821482
'Time::HiRes' => {
1483-
'DISTRIBUTION' => 'JHI/Time-HiRes-1.9751.tar.gz',
1483+
'DISTRIBUTION' => 'JHI/Time-HiRes-1.9758.tar.gz',
14841484
'FILES' => q[dist/Time-HiRes],
1485-
# for overly slow smokers
1486-
'CUSTOMIZED' => [qw( t/nanosleep.t typemap )],
1485+
# for overly slow smokers. See https://github.com/rurban/Time-HiRes
1486+
# also typemap fixes for ANONIO
1487+
'CUSTOMIZED' => [ qw( HiRes.xs t/alarm.t t/clock.t t/itimer.t
1488+
t/nanosleep.t t/usleep.t t/utime.t typemap) ],
14871489
},
14881490

14891491
'Time::Local' => {

dist/Module-CoreList/lib/Module/CoreList.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17620,6 +17620,7 @@ our %delta = (
1762017620
'TAP::Parser::YAMLish::Reader'=> '3.42_01',
1762117621
'TAP::Parser::YAMLish::Writer'=> '3.42_01',
1762217622
'Test::Harness' => '3.42_01',
17623+
'Time::HiRes' => '1.9758_01',
1762317624
'XSLoader' => '1.04c',
1762417625
},
1762517626
removed => {

dist/Time-HiRes/Changes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,68 @@
11
Revision history for the Perl extension Time::HiRes.
22

3+
1.9758_01 2018-09-06 rurban
4+
- merge with our old cperl fixes
5+
6+
1.9758 [2018-03-21]
7+
- fix build in Win32 with Visual C by introducing a fake struct timezone
8+
[rt.cpan.org #124844]
9+
- in utime.t detect better being run in a noatime filesystem,
10+
and if so, skip the test (for the HAMMER filesystem of DragonflyBSD)
11+
- also for the HAMMER fs (if not in noatime), lower the expected subsecond
12+
timestamp granularity to microseconds
13+
- fix the version number typo in Changes: 1.9577 -> 1.9757
14+
15+
1.9757 [2018-03-15]
16+
- fix win32 (and cygwin?) builds which have been broken since 1.9755:
17+
problem was that gettimeofday() is a macro and needs to stay such
18+
- regenerate ppport.h with Perl 5.26.1 (was previously generated with
19+
5.25.6) and Devel::PPPort 3.35 (previously 3.36) -- this doesn't
20+
change the ppport.h, though
21+
22+
1.9756 [2018-03-14]
23+
- division by zero in new test tv_interval.t [rt.cpan.org #124775]:
24+
made the test pass even if the difference is zero, but also
25+
made it practically impossible to ever be zero by adding
26+
a sub-second sleep.
27+
- remove comments from inside qw [rt.cpan.org #124777],
28+
only seemed to be caught by Perl 5.18.4
29+
30+
1.9755 [2018-03-14]
31+
- adjust the error messages of tv_interval()
32+
- the NV_1EX constants now cast to be NV so that
33+
tv_interval() with long double builds does not
34+
produce ugly results [rt.cpan.org #106456]
35+
- add tests for tv_interval()
36+
- centralize the mygettimeofday() logic
37+
- make the mygettimeofday() a function instead of macro
38+
- add the OS X 10.12+ clock_gettime() constants
39+
CLOCK_MONOTONIC_RAW_APPROX CLOCK_UPTIME_RAW_APPROX
40+
- regenerate the fallback files
41+
42+
1.9754 [2018-02-16]
43+
- unify the gettimeofday() and time() forked code
44+
that had near identical code paths for MacOS Classic
45+
(which has two unusual features: unsigned time_t,
46+
and a special tz struct member), and for non-MacOS Classic
47+
- tv_interval should be implemented in XS
48+
[rt.cpan.org #106456]
49+
thanks to Sergey Aleynikov (suggested implementation simplified
50+
by the above-mentioned MacOS Classic simplification)
51+
52+
1.9753 [2018-01-11]
53+
- in t/clock.t in a fast system we need to burn more CPU,
54+
reported and fix suggested by Joel C. Maslak <jmaslak@antelope.net>
55+
[rt.cpan.org #124025]
56+
- for t/utime.t in netbsd we need /sbin in PATH to find the mount command,
57+
this is needed for the fix in 1.9751 to actually help netbsd with noatime
58+
mounts.
59+
(thanks to Nigel Horne)
60+
61+
1.9752 [2018-01-04]
62+
- fix an error in the error message of utimensat() not available:
63+
it said futimens() not available
64+
- add --force alias for Makefile.PL --configure
65+
366
1.9751 [2018-01-02]
467
- in macOS/OSX/Darwin, use __has_builtin() check also for utimensat(),
568
can cause errors like

dist/Time-HiRes/HiRes.pm

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package Time::HiRes;
22

3-
{ use 5.006; }
3+
use 5.006;
44
use strict;
55

66
require Exporter;
77
use XSLoader ();
88

99
our @ISA = qw(Exporter);
10-
1110
our @EXPORT = qw( );
12-
# More or less this same list is in Makefile.PL. Should unify.
11+
# TODO: this list is a superset of the @names in
12+
# Makefile.PL:doConstants(), automate this somehow.
1313
our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
1414
getitimer setitimer nanosleep clock_gettime clock_getres
1515
clock clock_nanosleep
@@ -21,6 +21,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
2121
CLOCK_MONOTONIC_FAST
2222
CLOCK_MONOTONIC_PRECISE
2323
CLOCK_MONOTONIC_RAW
24+
CLOCK_MONOTONIC_RAW_APPROX
2425
CLOCK_PROCESS_CPUTIME_ID
2526
CLOCK_PROF
2627
CLOCK_REALTIME
@@ -37,6 +38,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
3738
CLOCK_UPTIME_FAST
3839
CLOCK_UPTIME_PRECISE
3940
CLOCK_UPTIME_RAW
41+
CLOCK_UPTIME_RAW_APPROX
4042
CLOCK_VIRTUAL
4143
ITIMER_PROF
4244
ITIMER_REAL
@@ -50,7 +52,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
5052
stat lstat utime
5153
);
5254

53-
our $VERSION = '1.9751';
55+
our $VERSION = '1.9758_01';
5456
our $XS_VERSION = $VERSION;
5557
$VERSION = eval $VERSION;
5658

@@ -95,13 +97,6 @@ XSLoader::load( 'Time::HiRes', $XS_VERSION );
9597

9698
# Preloaded methods go here.
9799

98-
sub tv_interval {
99-
# probably could have been done in C
100-
my ($a, $b) = @_;
101-
$b = [gettimeofday()] unless defined($b);
102-
(${$b}[0] - ${$a}[0]) + ((${$b}[1] - ${$a}[1]) / 1_000_000);
103-
}
104-
105100
# Autoload methods go after =cut, and are processed by the autosplit program.
106101

107102
1;

0 commit comments

Comments
 (0)