in reply to measuring startup time: how early does $^T (start time of program) get set?
$^T is far too coarse for yoru kind of measurement, as it measures whole seconds only.
If you want to measure compilation time, you can try something like this — put it near the very top of your script:
use Time::HiRes; my $t0; BEGIN { $t0 = Time::HiRes::time; } my $t1 = Time::HiRes::time; printf STDERR "Compilation time: %.3f seconds\n", $t1-$t0;
$t0 is set in the BEGIN block, at the start of the compilation cycle. $t1 is set when the script actually starts to run, thus after compilation is complete. Next it prints out the difference, in fractions of seconds.
This will still miss the startup time of perl itself.
|
|---|