Syntax-Operator-Zip
view release on metacpan or search on metacpan
t/95benchmark.t view on Meta::CPAN
use Test2::V0;
BEGIN {
eval { require List::Util; List::Util->VERSION(1.56) } or
plan skip_all => "List::Util v1.56 is not available";
}
# This "test" never fails, but prints a benchmark comparison between these
# wrapper functions and the ones in Scalar::Util
use Time::HiRes qw( gettimeofday tv_interval );
sub measure(&)
{
my ( $code ) = @_;
my $start = [ gettimeofday ];
$code->();
return tv_interval $start;
}
my @nums = ( 1 .. 100 );
my $COUNT = 5_000;
( run in 0.285 second using v1.01-cache-2.11-cpan-49f99fa48dc )