Skip to content

Commit 4af004a

Browse files
committed
Merge branch 'jn/gitweb-time-hires-comes-with-5.8'
* jn/gitweb-time-hires-comes-with-5.8: gitweb: Time::HiRes is in core for Perl 5.8
2 parents 3d90c79 + 3962f1d commit 4af004a

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

gitweb/gitweb.perl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
use Fcntl ':mode';
1818
use File::Find qw();
1919
use File::Basename qw(basename);
20+
use Time::HiRes qw(gettimeofday tv_interval);
2021
binmode STDOUT, ':utf8';
2122

22-
our $t0;
23-
if (eval { require Time::HiRes; 1; }) {
24-
$t0 = [Time::HiRes::gettimeofday()];
25-
}
23+
our $t0 = [ gettimeofday() ];
2624
our $number_of_git_cmds = 0;
2725

2826
BEGIN {
@@ -1078,7 +1076,7 @@ sub dispatch {
10781076
}
10791077

10801078
sub reset_timer {
1081-
our $t0 = [Time::HiRes::gettimeofday()]
1079+
our $t0 = [ gettimeofday() ]
10821080
if defined $t0;
10831081
our $number_of_git_cmds = 0;
10841082
}
@@ -3651,7 +3649,7 @@ sub git_footer_html {
36513649
print "<div id=\"generating_info\">\n";
36523650
print 'This page took '.
36533651
'<span id="generating_time" class="time_span">'.
3654-
Time::HiRes::tv_interval($t0, [Time::HiRes::gettimeofday()]).
3652+
tv_interval($t0, [ gettimeofday() ]).
36553653
' seconds </span>'.
36563654
' and '.
36573655
'<span id="generating_cmd">'.
@@ -5517,7 +5515,7 @@ sub git_blame_common {
55175515
print 'END';
55185516
if (defined $t0 && gitweb_check_feature('timed')) {
55195517
print ' '.
5520-
Time::HiRes::tv_interval($t0, [Time::HiRes::gettimeofday()]).
5518+
tv_interval($t0, [ gettimeofday() ]).
55215519
' '.$number_of_git_cmds;
55225520
}
55235521
print "\n";

0 commit comments

Comments
 (0)