Created
April 9, 2016 19:44
-
-
Save zoffixznet/1632bde46cd296a45de0946c6b128907 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
sub cry_prime { | |
for ^Inf { | |
my @results = ( | |
await ^4 .map: { | |
start { | |
sleep 1; | |
my $r = rand; | |
$r > .6 ?? $r !! False; | |
} | |
} | |
).grep: {$_}; | |
next unless @results; | |
return @results[0]; | |
} | |
}; | |
say cry_prime; | |
say now - INIT now; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment