Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created October 3, 2016 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/685bc5495852383b6f039333471b5cc1 to your computer and use it in GitHub Desktop.
Save zoffixznet/685bc5495852383b6f039333471b5cc1 to your computer and use it in GitHub Desktop.
constant $i = 2_000_000;
my &code = { for ^$i { } };
my $start = now; ^4 .map: &code; my $stop = now;
say "Serial: {$stop - $start}";
$start = now; await ^4 .map: {start code}; $stop = now;
say "Parallel: {$stop - $start}";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment