#!/usr/bin/perl $start = time; sleep(2); #or some other crazy pieces of code $end = time; $length = $end - $start; print "It took us $length seconds to do the job.\n";