use Time::HiRes; my $t0; BEGIN { $t0 = Time::HiRes::time; } my $t1 = Time::HiRes::time; printf STDERR "Compilation time: %.3f seconds\n", $t1-$t0;