Skip to content

Commit dcaed00

Browse files
committed
Make Time::HiRes a mandatory dependency
1 parent 4f71641 commit dcaed00

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

lib/App/Prove/State/Result/Test.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ TODO passed).
113113
114114
=head3 C<run_time>
115115
116-
The total time it took for the test to run, in seconds. If C<Time::HiRes> is
117-
available, it will have finer granularity.
116+
The total time it took for the test to run, in seconds.
118117
119118
=head3 C<num_todo>
120119

lib/TAP/Base.pm

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ Version 3.51_01
1818

1919
our $VERSION = '3.51_01';
2020

21-
use constant GOT_TIME_HIRES => do {
22-
eval 'use Time::HiRes qw(time);';
23-
$@ ? 0 : 1;
24-
};
21+
use Time::HiRes qw(time);
2522

2623
=head1 SYNOPSIS
2724
@@ -107,19 +104,14 @@ sub _make_callback {
107104

108105
=head3 C<get_time>
109106
110-
Return the current time using Time::HiRes if available.
107+
Return the current time.
111108
112109
=cut
113110

114111
sub get_time { return time() }
115112

116-
=head3 C<time_is_hires>
117-
118-
Return true if the time returned by get_time is high resolution (i.e. if Time::HiRes is available).
119-
120-
=cut
121-
122-
sub time_is_hires { return GOT_TIME_HIRES }
113+
# kept for backwards compatability
114+
sub time_is_hires { return 1 }
123115

124116
=head3 C<get_times>
125117

lib/TAP/Formatter/Base.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Printing individual test results to STDOUT.
141141
142142
=item * C<timer>
143143
144-
Append run time for each test to output. Uses L<Time::HiRes> if available.
144+
Append run time for each test to output.
145145
146146
=item * C<failures>
147147

lib/TAP/Harness.pm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ Set the verbosity level:
156156
157157
=item * C<timer>
158158
159-
Append run time for each test to output. Uses L<Time::HiRes> if
160-
available.
159+
Append run time for each test to output.
161160
162161
=item * C<failures>
163162

lib/Test/Harness.pm

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ use TAP::Parser::Source ();
1414
use TAP::Parser::SourceHandler::Perl ();
1515

1616
use Text::ParseWords qw(shellwords);
17+
use Time::HiRes 'time';
1718

1819
use Config;
1920
use base 'Exporter';
2021

2122
# $ML $Last_ML_Print
2223

23-
BEGIN {
24-
eval q{use Time::HiRes 'time'};
25-
our $has_time_hires = !$@;
26-
}
24+
our $has_time_hires = 1;
2725

2826
=head1 NAME
2927

0 commit comments

Comments
 (0)