Created
October 3, 2016 04:07
-
-
Save zoffixznet/685bc5495852383b6f039333471b5cc1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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