{"thread":{"id":"25689","subject":"[PATCH] gitweb: Time::HiRes is in core for Perl 5.8","startedAt":"2010-11-09T18:27:54Z","lastAt":"2010-11-11T19:01:48Z","messageCount":3,"participants":["Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"155504","messageId":"20101109182754.15256.996.stgit@localhost.localdomain","threadId":"25689","inReplyTo":null,"subject":"[PATCH] gitweb: Time::HiRes is in core for Perl 5.8","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-11-09T18:27:54Z","receivedAt":"2010-11-09T18:27:54Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"\n\nTherefore there is no need to check if it is installed.  We can also\nimport gettimeofday and tv_interval.\n\nSigned-off-by: Jakub Narebski <jnareb@gmail.com>\n---\n\n gitweb/gitweb.perl |   12 +++++-------\n 1 files changed, 5 insertions(+), 7 deletions(-)\n\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex 5445159..0813479 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -17,12 +17,10 @@ use Encode;\n use Fcntl ':mode';\n use File::Find qw();\n use File::Basename qw(basename);\n+use Time::HiRes qw(gettimeofday tv_interval);\n binmode STDOUT, ':utf8';\n \n-our $t0;\n-if (eval { require Time::HiRes; 1; }) {\n-\t$t0 = [Time::HiRes::gettimeofday()];\n-}\n+our $t0 = [ gettimeofday() ];\n our $number_of_git_cmds = 0;\n \n BEGIN {\n@@ -1065,7 +1063,7 @@ sub dispatch {\n }\n \n sub reset_timer {\n-\tour $t0 = [Time::HiRes::gettimeofday()]\n+\tour $t0 = [ gettimeofday() ]\n \t\tif defined $t0;\n \tour $number_of_git_cmds = 0;\n }\n@@ -3601,7 +3599,7 @@ sub git_footer_html {\n \t\tprint \"<div id=\\\"generating_info\\\">\\n\";\n \t\tprint 'This page took '.\n \t\t      '<span id=\"generating_time\" class=\"time_span\">'.\n-\t\t      Time::HiRes::tv_interval($t0, [Time::HiRes::gettimeofday()]).\n+\t\t      tv_interval($t0, [ gettimeofday() ]).\n \t\t      ' seconds </span>'.\n \t\t      ' and '.\n \t\t      '<span id=\"generating_cmd\">'.\n@@ -5310,7 +5308,7 @@ sub git_blame_common {\n \t\tprint 'END';\n \t\tif (defined $t0 && gitweb_check_feature('timed')) {\n \t\t\tprint ' '.\n-\t\t\t      Time::HiRes::tv_interval($t0, [Time::HiRes::gettimeofday()]).\n+\t\t\t      tv_interval($t0, [ gettimeofday() ]).\n \t\t\t      ' '.$number_of_git_cmds;\n \t\t}\n \t\tprint \"\\n\";\n"},{"id":"155708","messageId":"7vwrojhjiz.fsf@alter.siamese.dyndns.org","threadId":"25689","inReplyTo":"20101109182754.15256.996.stgit@localhost.localdomain","subject":"Re: [PATCH] gitweb: Time::HiRes is in core for Perl 5.8","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-11-11T17:12:04Z","receivedAt":"2010-11-11T17:12:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Therefore there is no need to check if it is installed.  We can also\n> import gettimeofday and tv_interval.\n>\n> Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n\nI think \"... and 'use 5.008' is at the begining of the script already, \"\nis missing before that \"Therefore\".  But otherwise it is a reasonable\nthing to do.\n\nThanks.\n"},{"id":"155729","messageId":"201011112001.50202.jnareb@gmail.com","threadId":"25689","inReplyTo":"7vwrojhjiz.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] gitweb: Time::HiRes is in core for Perl 5.8","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-11-11T19:01:48Z","receivedAt":"2010-11-11T19:01:48Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n> Jakub Narebski <jnareb@gmail.com> writes:\n> \n> > Therefore there is no need to check if it is installed.  We can also\n> > import gettimeofday and tv_interval.\n> >\n> > Signed-off-by: Jakub Narebski <jnareb@gmail.com>\n> \n> I think \"... and 'use 5.008' is at the begining of the script already, \"\n\nbecause gitweb requires Perl 5.8, in order to have good Unicode support.\n\n> is missing before that \"Therefore\".  But otherwise it is a reasonable\n> thing to do.\n> \n> Thanks.\n\nWould you amend commit message when applying it, then?\n-- \nJakub Narebski\nPoland\n"}]}