List-Keywords
view release on metacpan or search on metacpan
t/95benchmark.t view on Meta::CPAN
use v5.14;
use warnings;
use Test2::V0;
# This "test" never fails, but prints a benchmark comparison between these
# util functions and the ones provided by List::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 = 10_000;
( run in 1.036 second using v1.01-cache-2.11-cpan-49f99fa48dc )