Created
May 28, 2016 02:09
-
-
Save zoffixznet/4e0b776a61239888cc0a1a019736dbf7 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 = 1; | |
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