-
-
Save zoffixznet/fbd3578cc9e2d75d9b7daae6b83c1b31 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
#!/usr/bin/perl6 | |
my @primes; | |
PRIME: loop (my $n = 2; $n <= 10_000; $n++) { | |
next PRIME if $n %% $_ for @primes; | |
@primes.push: $n; | |
} | |
my $time = now - ENTER now; | |
say "Found {+@primes} primes in {$time}s ({round(+@primes / $time)} P/s)"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment