The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Chj::time_this - benchmarking function that also returns the result(s)

SYNOPSIS

    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

DESCRIPTION

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

SEE ALSO

 L<Benchmark>

NOTE

This is alpha software! Read the status section in the package README or on the website.