Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created May 28, 2016 02:09
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/4e0b776a61239888cc0a1a019736dbf7 to your computer and use it in GitHub Desktop.
Save zoffixznet/4e0b776a61239888cc0a1a019736dbf7 to your computer and use it in GitHub Desktop.
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