Created
May 28, 2016 02:17
-
-
Save zoffixznet/be7b404f52aa4b6977fee17e17b82910 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 TIMES = 100_000; | |
constant CORES = 4; | |
my @results = await ^CORES .map: { | |
start { eager ^(TIMES / CORES) .map({ rand**2 + rand**2 }).grep: * < 1 }; | |
}; | |
say @results».elems.sum / TIMES * 4; | |
say now - INIT now; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment