#!/usr/bin/perl -Tw # heavily commented for the sake of this post # presents time in my chosen format use POSIX qw/strftime/; # used for the Perl page rendered time I'm trying to produce use Time::HiRes qw/gettimeofday tv_interval/; # trickery to send the page as application/xhtml+xml, # if the client supports it if ($ENV{'HTTP_ACCEPT'} =~ /application\/xhtml\+xml/) { print "content-type:application/xhtml+xml; charset=utf-8\n\n"; } else { print "content-type:text/html; charset=utf-8\n\n"; } # here's where I start my timer my $start_time = [gettimeofday]; # just to add some of my local routines to my @INC use lib './localincs/'; # again, my preferred time format (has nothing to do with my timer) my $utc_time = strftime('%F %T %z',localtime); ...yadda,yadda,yadda... # bottom of web page, just before my $total_time = tv_interval($start_time); # the following line should present something like this: # Page processed by Perl in 0.00001 seconds # But only produces the Perl version number printf('Page processed by Perl %s in %.02f seconds',$],$total_time);