Anthony Ettinger wrote: : #!/usr/bin/perl -w : : use vars qw($start_time $end_time); : use strict; : : BEGIN { : $start_time = time(); : } : : sub log_time { : my $exit_code = shift; : my $elapsed_time = $end_time - $start_time; : : print $elapsed_time, "\n"; : } : : END { : $end_time = time(); : &log_time($?); : } : : __END__
BEGIN { my $start_time = time(); sub log_time { # my $exit_code = shift; print time() - $start_time, "\n"; } } END { log_time($?); } Or, if this is not a persistant perl enviroment, like modperl, just this. END { # $^T is the time at which the program began # running, in seconds since the epoch. print $^T - time(), "\n"; } HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>