use BenchWrapper; my $BENCHMARKIT = 1; ... my $bwo = BenchWrapper -> new( $BENCHMARKIT ); ... sub foo { my $t0 = $bwo -> mark; ... my $t1 = $bwo -> mark; ... } ... package BenchWrapper; use Benchmark; sub new { bless { BENCHMARKIT => shift() }; } sub mark { $_[0] -> { BENCHMARKIT } and return Benchmark -> new; } 1;
One world, one people
In reply to Re: benchmarking code conditionally
by anonymized user 468275
in thread benchmarking code conditionally
by punkish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |