From 06646037fce27cd24b2976024bc577049c0a5d45 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 4 Apr 2005 00:31:01 +0000 Subject: [PATCH] Added a timer for every page. --- html/ccbs.pm | 8 ++++++++ html/templates/main.tmpl | 1 + 2 files changed, 9 insertions(+) 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 @@ + -- 2.39.2