Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re^2: Getting timing details from a test

by mcdave (Beadle)
on Jan 13, 2011 at 18:11 UTC ( #882197=note: print w/replies, xml ) Need Help??

in reply to Re: Getting timing details from a test
in thread Getting timing details from a test

Thanks for mentioning "Benchmark". It turned out to be really easy to splice in. Just put some "new Benchmark" statements between my existing tests, and I'm good:
... use Benchmark qw(:hireswallclock); use Test::More ; ... $t0 = Benchmark->new ; ok(&test1, 'the first test') ; $t1 = Benchmark->new ; ok(&test2, 'test #2' ) ; $t2 = Benchmark->new ; ok(&test3, 'done now' ) ; $t3 = Benchmark->new ; note( 'the first test: ' . timestr(timediff($t1, $t0) ) ) ; note( 'test #2: ' . timestr(timediff($t2, $t1) ) ) ; note( 'done now: ' . timestr(timediff($t3, $t2) ) ) ;
That's giving output I can work with.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://882197]
[Lady_Aleena]: What?! Can't stat ~/Music: No such file or directory? The ~/ doesn't expand?
[Lady_Aleena]: And the env variable $HOME doesn't work either. !@#$
[shmem]: no, that's a shell feature. Use $ENV{HOME}
[marioroy]: my $ans = qx{ find \$HOME -name "*.pl" -exec ls -l {} \\; };
[marioroy]: must backslash $ inside qx

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2017-04-23 21:02 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (432 votes). Check out past polls.