my $t0 = new Benchmark; print 'Doing stuff... '; .. do a bunch of stuff with, say, DBI .. my $t1 = new Benchmark; print 'Done; This took: ' . timestr(timediff($t1, $t0)) . "\n";