From charlesreid1

While a profiler gives you a much more detailed picture of where time is spent in the code, sometimes you're just after an overall execution time or wall time for a single snippet. In that case, you can use Perl's built-in time function (which gives second-level granularity) or you can go for the High Resolution time library HiRes:

This is a drop-in replacement for time. So your Perl file just needs this:

use Time::HiRes qw(time);

my $start = time;
my $duration = time - $start;
printf "Execution time: %0.3f s \n",$duration;