Skip to content

Commit 3962f1d

Browse files
jnarebgitster
authored andcommitted
gitweb: Time::HiRes is in core for Perl 5.8
We say 'use 5.008' at the beginning of the script, therefore there is no need to check if Time::HiRes module is available. We can also import gettimeofday and tv_interval. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 6f10c41 commit 3962f1d

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 {
@@ -1065,7 +1063,7 @@ sub dispatch {
10651063
}
10661064

10671065
sub reset_timer {
1068-
our $t0 = [Time::HiRes::gettimeofday()]
1066+
our $t0 = [ gettimeofday() ]
10691067
if defined $t0;
10701068
our $number_of_git_cmds = 0;
10711069
}
@@ -3590,7 +3588,7 @@ sub git_footer_html {
35903588
print "<div id=\"generating_info\">\n";
35913589
print 'This page took '.
35923590
'<span id="generating_time" class="time_span">'.
3593-
Time::HiRes::tv_interval($t0, [Time::HiRes::gettimeofday()]).
3591+
tv_interval($t0, [ gettimeofday() ]).
35943592
' seconds </span>'.
35953593
' and '.
35963594
'<span id="generating_cmd">'.
@@ -5298,7 +5296,7 @@ sub git_blame_common {
52985296
print 'END';
52995297
if (defined $t0 && gitweb_check_feature('timed')) {
53005298
print ' '.
5301-
Time::HiRes::tv_interval($t0, [Time::HiRes::gettimeofday()]).
5299+
tv_interval($t0, [ gettimeofday() ]).
53025300
' '.$number_of_git_cmds;
53035301
}
53045302
print "\n";

0 commit comments

Comments
 (0)