geekondemand has asked for the wisdom of the Perl Monks concerning the following question:
This seems to be only loading the module on the first iteration. Is there a way to force the module to "unload".#!/usr/bin/perl use Time::HiRes; use Time::HiRes qw ( gettimeofday tv_interval ); my $iterations = 10000; $t0 = [gettimeofday]; foreach (1..$iterations) { use my_module; } $elapsed = tv_interval( $t0, [gettimeofday] ); print "Elapsed Time: $elapsed\n"; print "Iterations: $iterations\n"; print "Mean Time: " . ( $elapsed / $iterations ) . "\n";
I know I could simply time the entire script running each time, essentially writing one script to time another script, but I want to avoid timing the parsing of the surronding Perl code, I just want the time for the load of the module.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Timing a Module Load
by Fletch (Bishop) on Apr 29, 2005 at 19:48 UTC | |
by geekondemand (Scribe) on Apr 29, 2005 at 20:00 UTC | |
|
Re: Timing a Module Load
by mda2 (Hermit) on Apr 29, 2005 at 22:45 UTC | |
by salva (Canon) on Apr 30, 2005 at 15:52 UTC | |
|
Re: Timing a Module Load
by saintmike (Vicar) on Apr 29, 2005 at 20:08 UTC | |
by suaveant (Parson) on Apr 29, 2005 at 20:40 UTC | |
|
Re: Timing a Module Load
by halley (Prior) on Apr 30, 2005 at 18:18 UTC | |
|
Re: Timing a Module Load
by eibwen (Friar) on Apr 30, 2005 at 01:54 UTC | |
by Tanktalus (Canon) on Apr 30, 2005 at 03:57 UTC |