Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Compile Phase Time

by Anonymous Monk
on Apr 20, 2013 at 14:05 UTC ( #1029641=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Compile Phase Time
in thread Compile Phase Time

Yes, but it doesn't really matter , whole exercise is silly. This version won't, but it will fail at loading Moose twice (or after moo)

#!/usr/bin/perl -- use strict; use warnings; use Module::Load ; use Time::HiRes qw/ time /; @ARGV or @ARGV = qw/ CGI B::Deparse DBI DBD::SQLite Moose Moo /; for my $mod( @ARGV ){ my $tb = time; { local $SIG{__WARN__} = sub{}; undef %INC; load( $mod ); } my $ta = time; printf "%.5f - %.5f = %.5f %s\n", $ta, $tb, $ta - $tb, $mod; } __END__ $ perl fudge Moose Moo CGI CGI CGI CGI 1366466283.45313 - 1366466282.70313 = 0.75000 Moose 1366466283.52620 - 1366466283.45344 = 0.07276 Moo 1366466283.63069 - 1366466283.52631 = 0.10438 CGI 1366466283.73354 - 1366466283.63081 = 0.10273 CGI 1366466283.83594 - 1366466283.73366 = 0.10228 CGI 1366466283.93854 - 1366466283.83606 = 0.10247 CGI


Comment on Re^3: Compile Phase Time
Download Code
Re^4: Compile Phase Time
by Coder1979 (Initiate) on Apr 22, 2013 at 18:37 UTC
    Thank you folks for the valuable info. I really appreciate it.
Re^4: Compile Phase Time
by Coder1979 (Initiate) on Apr 22, 2013 at 20:38 UTC
    With every run this code returns a different result with the difference being between .1 - .2 s Any ideas why ?

      With every run this code returns a different result with the difference being between .1 - .2 s Any ideas why ?

      That is how stuff works, there is variability in everything -- the harddisk spins, sometimes it takes more time to read a file, sometimes less, sometimes its retrieved completely from cache ... think of timing a run/sprint/race with a finger-clicked-stopwatch -- sometimes you run faster, sometimes timer/coach fingers/thumbs slower -- its why runs are averaged, its like statistics or something :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1029641]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-08-30 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls