use Time::HiRes; ... my $start = Time::HiRes::time(); ... do your job ... my $stop = Time::HiRes::time(); my $duration = $stop-$start;