use strict;
use warnings;
use Time::HiRes qw (gettimeofday tv_interval);
my @bignum = (1..100000000);
my $native_map_start_time = [gettimeofday];
my @native_map = map { $_ * $_ } @bignum;
my $native_elapsed_time = tv_interval($native_map_start_time);
printf "The elapsed time with native map is %2.2f seconds\n", $native_elapsed_time;
####
$ perl native_map.pl
The elapsed time with native map is 8.57 seconds
####
use strict;
use warnings;
use MCE::Map;
use Time::HiRes qw (gettimeofday tv_interval);
my $mce_start_time = [gettimeofday];
my @mce_map = mce_map_s { $_ * $_ }1, 100000000;
my $mce_elapsed = tv_interval($mce_start_time);
printf "The elapsed time with MCE::map (mce_map_s) is %2.2f seconds\n", $mce_elapsed;
####
perl mce_map.pl
The elapsed time with MCE::map (mce_map_s) is 25.34 seconds
####
uname -rv
5.10.0-0.bpo.7-amd64 #1 SMP Debian 5.10.40-1~bpo10+1 (2021-06-04)