Marcel Grünauer > App-Benchmark-2.00 > App::Benchmark

Download:
App-Benchmark-2.00.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 2.00   Source  

NAME ^

App::Benchmark - Output your benchmarks as test diagnostics

SYNOPSIS ^

    # This is t/benchmark.t:

    use App::Benchmark;

    benchmark_diag(2_000_000, {
        sqrt => sub { sqrt(2) },
        log  => sub { log(2) },
    });

DESCRIPTION ^

This module makes it easy to run your benchmarks in a distribution's test suite. This way you just have to look at the CPAN testers reports to see your benchmarks being run on many different platforms using many different versions of perl.

Ricardo Signes came up with the idea.

FUNCTIONS ^

benchmark_diag

Takes a number of iterations and a benchmark definition hash, just like timethese() from the Benchmark module. Runs the benchmarks and reports them, each line prefixed by a hash sign so it doesn't mess up the TAP output. Also, a dummy test is being generated to keep the testing framework happy.

This function is exported automatically.

AUTHORS ^

The following person is the author of all the files provided in this distribution unless explicitly noted otherwise.

Marcel Gruenauer <marcel@cpan.org>, http://marcelgruenauer.com

COPYRIGHT AND LICENSE ^

The following copyright notice applies to all the files provided in this distribution, including binary files, unless explicitly noted otherwise.

This software is copyright (c) 2008 by Marcel Gruenauer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: