in reply to Timing Compile time, or timing 'use'.

You could temporarily replace the true values at the end of each module you are using with

warn time();

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^2: Timing Compile time, or timing 'use'.
by Corion (Patriarch) on Jan 30, 2007 at 09:19 UTC

    When debugging some dynamic loading and fighting UNIVERSAL::require, I found the following very helpful to have at the end of every package:

    warn __PACKAGE__ . " loaded\n";

    which should be combined with your approach to give the timestamps too.

    Another approach might be to load a coderef into @INC that turns around and loads all modules while outputting timing information:

    perl -MDevel::TimeLoad myprogram.pl

    ... but I don't have the time to implement a prototype for that.

      There are several packages on my system that have a warn __PACKAGE__; at the end as a result of my trying debug some problem or other. Every now and again I'll use one, see the output and get around to removing it.

      I really like your Devel::TimeLoad idea. There are many occasions when such a beast would have be very useful. I've seen references to 'coderefs in @INC' float by over the last year or so, but I've never had occasion to go read up about them. Indeed, off the top of my head I don't know where to look, but I'll find it.

      Someone will probably beat me to the punch, but if there isn't such a module on cpan by the time I've worked out how/what to do, I'll put my efforts up there.

      I'd also like to write a -MO style shortcut for Devel modules to facilitate their use from the command line, but of the top of my head I haven't a clue if that's possible?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        You're looking for -d:YourModule which maps to Devel::YourModule. -MO=YourModule maps to B::YourModule and you probably don't want that.

        ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊