Using much more lightweight code (for a FreeBSD system), I get around 30 milliseconds when not loading Carp, and 90 msecs when I do. Here is the code I used:
use Carp; # comment this line out, or not
use BSD::Process;
my $t = BSD::Process->new->elapsed_time;
print $t, $/; # time in milliseconds
The times are very erratic. It seems to boil down to whether the process executes within one timeslice of the processor or not: there are definite quanta to the amount of time taken. Nevertheless, sometimes people may care about 0.06 seconds of startup time (certainly less non-negligible than 4 usec).
• another intruder with the mooring in the heart of the Perl
|