Chj::time_this - benchmarking function that also returns the result(s)
use Chj::tim; my $res = time_this { somefunc(66) }; # prints timing to stderr # or my $res = time_this { somefunc(66) } "somefunc"; # included in message # or my $res = time_this { somefunc(66) } msg => "somefunc", n => 10; # run thunk 10 times # or my $res = time_this { somefunc(66) } out => \@t; # push to @t instead of stderr
Currently does not divide the timings by the number of iterations.
Currently does not subtract the overhead of calling the thunk (as Benchmark.pm does, but can't use it since it doesn't return values; should we wrap and use assignment instead? But then timings are off again.)
Also should probably follow the output format of Benchmark.pm
L<Benchmark>
This is alpha software! Read the status section in the package README or on the website.
To install FunctionalPerl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FunctionalPerl
CPAN shell
perl -MCPAN -e shell install FunctionalPerl
For more information on module installation, please visit the detailed CPAN module installation guide.