]> git.sesse.net Git - ccbs/commitdiff
Added a timer for every page.
authorSteinar H. Gunderson <sesse@samfundet.no>
Mon, 4 Apr 2005 00:31:01 +0000 (00:31 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Mon, 4 Apr 2005 00:31:01 +0000 (00:31 +0000)
html/ccbs.pm
html/templates/main.tmpl

index 81955433fc50001a4e28aad4a0a5b4e4ef8127ae..61dadf8f529e31638989b8794441509216582292 100755 (executable)
@@ -3,9 +3,16 @@ use Template;
 use CGI;
 use DBI;
 use HTML::Entities;
 use CGI;
 use DBI;
 use HTML::Entities;
+use Time::HiRes;
 use strict;
 use warnings;
 
 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 :-)
 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->{'page'} = $page;
        $vars->{'title'} = $title;
        $vars->{'public'} = $ccbs_noadmin;
+       $vars->{'timetogenerate'} = sprintf "%.3f", Time::HiRes::tv_interval($start_time);
        
        my $config = {
                INCLUDE_PATH => 'templates/',
        
        my $config = {
                INCLUDE_PATH => 'templates/',
index 46b0e5d31dba48a6e19554402e08292aeb34bd11..32ce8ce40fde76b8c9417f6cd4587b4d4977e2da 100644 (file)
@@ -22,3 +22,4 @@
     </div>
   </body>
 </html>
     </div>
   </body>
 </html>
+<!-- Data acquisition and processing took [% timetogenerate %] seconds. -->