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