in reply to Re^2: Badly need to call a function...:-)
in thread Badly need to call a function...:-)
use Benchmark qw(cmpthese); @data = (1,2,3,4); # the values that would have been in @_ my $minCPUsec = 15; cmpthese(-$minCPUsec, { with => \&sub_with_ifs, without => \&sub_without_ifs });
And change @_ in the referenced subs to @data.
Additionally, you may be interested in the Benchmarking Your Code tutorial, but I'd recommend using cmpthese instead of timethese.
|
|---|