Skip to content

Instantly share code, notes, and snippets.

@theraccoonbear
Last active May 8, 2020 14:54
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 theraccoonbear/d751d9293a4d0a9876ab047d1fec53d7 to your computer and use it in GitHub Desktop.
Save theraccoonbear/d751d9293a4d0a9876ab047d1fec53d7 to your computer and use it in GitHub Desktop.
dsmith@pop-os ~/code/other/sandbox/sieve (master) $ yarn start --check 10
yarn run v1.21.1
$ node index.js --check 10
Primes between 1 and 10 WITH sieve:
3 primes!
0.00 second(s) elapsed
-----------------------------------------------------------------
Counting primes between 1 and 10 WITHOUT sieve:
3 primes!
0.00 second(s) elapsed
-----------------------------------------------------------------
Done in 0.07s.
dsmith@pop-os ~/code/other/sandbox/sieve (master) $ yarn start --check 100
yarn run v1.21.1
$ node index.js --check 100
Primes between 1 and 100 WITH sieve:
24 primes!
0.00 second(s) elapsed
-----------------------------------------------------------------
Counting primes between 1 and 100 WITHOUT sieve:
24 primes!
0.00 second(s) elapsed
-----------------------------------------------------------------
Done in 0.08s.
dsmith@pop-os ~/code/other/sandbox/sieve (master) $ yarn start --check 1000
yarn run v1.21.1
$ node index.js --check 1000
Primes between 1 and 1,000 WITH sieve:
167 primes!
0.00 second(s) elapsed
-----------------------------------------------------------------
Counting primes between 1 and 1,000 WITHOUT sieve:
167 primes!
0.00 second(s) elapsed
-----------------------------------------------------------------
Done in 0.07s.
dsmith@pop-os ~/code/other/sandbox/sieve (master) $ yarn start --check 10000
yarn run v1.21.1
$ node index.js --check 10000
Primes between 1 and 10,000 WITH sieve:
1,228 primes!
0.01 second(s) elapsed
-----------------------------------------------------------------
Counting primes between 1 and 10,000 WITHOUT sieve:
1,228 primes!
0.05 second(s) elapsed
-----------------------------------------------------------------
Done in 0.13s.
dsmith@pop-os ~/code/other/sandbox/sieve (master) $ yarn start --check 100000
yarn run v1.21.1
$ node index.js --check 100000
Primes between 1 and 100,000 WITH sieve:
9,591 primes!
0.13 second(s) elapsed
-----------------------------------------------------------------
Counting primes between 1 and 100,000 WITHOUT sieve:
9,591 primes!
1.14 second(s) elapsed
-----------------------------------------------------------------
dsmith@pop-os ~/code/other/sandbox/sieve (master) $ yarn start --check 1000000
yarn run v1.21.1
$ node index.js --check 1000000
Primes between 1 and 1,000,000 WITH sieve:
78497 primes!
2.62 second(s) elapsed
-----------------------------------------------------------------
Counting primes between 1 and 1000000 WITHOUT sieve:
78497 primes!
33.01 second(s) elapsed
-----------------------------------------------------------------
Done in 35.70s.
dsmith@pop-os ~/code/other/sandbox/sieve (master) $ yarn start --check 10000000
yarn run v1.21.1
$ node index.js --check 10000000
Primes between 1 and 10,000,000 WITH sieve:
664,578 primes!
70.00 second(s) elapsed
-----------------------------------------------------------------
Counting primes between 1 and 10,000,000 WITHOUT sieve:
664,578 primes!
1095.64 second(s) elapsed
-----------------------------------------------------------------
Done in 1165.73s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment