| 1 | package App::Benchmark; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use Test::More; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Benchmark qw(cmpthese timethese :hireswallclock); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Capture::Tiny qw(capture); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use Exporter qw(import); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | our $VERSION = '2.00'; | |
| 9 | 1 | our @EXPORT = qw(benchmark_diag); | |
| 10 | |||
| 11 | 1 | ▶ | sub benchmark_diag { |
|
Subroutine
benchmark_diag: called CC=1 SCAR=0.0
Pod
documented
| |||
| 12 | 1 | my ($iterations, $benchmark_hash) = @_; | |
| 13 | 1 | ▶ | my $stdout = capture { |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 14 | 1 | cmpthese(timethese($iterations, $benchmark_hash)); | |
| 15 | 1 | }; | |
| 16 | 1 | diag $stdout; | |
| 17 | 1 | plan tests => 1; | |
| 18 | 1 | pass('benchmark'); | |
| 19 | } | ||
| 20 | 1 | 1; | |
| 21 | __END__ | ||