use Carp; # comment this line out, or not use BSD::Process; my $t = BSD::Process->new->elapsed_time; print $t, $/; # time in milliseconds