Skip to content

Instantly share code, notes, and snippets.

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/1632bde46cd296a45de0946c6b128907 to your computer and use it in GitHub Desktop.
Save zoffixznet/1632bde46cd296a45de0946c6b128907 to your computer and use it in GitHub Desktop.
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