From: Steinar H. Gunderson Date: Mon, 4 Apr 2005 00:31:01 +0000 (+0000) Subject: Added a timer for every page. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=06646037fce27cd24b2976024bc577049c0a5d45;hp=dd28e295d7cc627fea49ed1579ab689e17bca915;ds=sidebyside Added a timer for every page. --- diff --git a/html/ccbs.pm b/html/ccbs.pm index 8195543..61dadf8 100755 --- a/html/ccbs.pm +++ b/html/ccbs.pm @@ -3,9 +3,16 @@ use Template; use CGI; use DBI; use HTML::Entities; +use Time::HiRes; use strict; use warnings; +our $start_time; + +BEGIN { + $start_time = [Time::HiRes::gettimeofday()]; +} + our $ccbs_dbdebug = 0; # Set this flag to disable any admin tasks -- it's quite crude, but hey :-) @@ -64,6 +71,7 @@ sub process_template { $vars->{'page'} = $page; $vars->{'title'} = $title; $vars->{'public'} = $ccbs_noadmin; + $vars->{'timetogenerate'} = sprintf "%.3f", Time::HiRes::tv_interval($start_time); my $config = { INCLUDE_PATH => 'templates/', diff --git a/html/templates/main.tmpl b/html/templates/main.tmpl index 46b0e5d..32ce8ce 100644 --- a/html/templates/main.tmpl +++ b/html/templates/main.tmpl @@ -22,3 +22,4 @@ +