Skip to content
Sign UpLog In
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
4

prime number generator

codeitfast
codeitfast

I decided, while on IDLE, to create a prime number generator. With this, you can find any prime number (as long as your computer is strong enough).


Please upvote!

2 years ago

Voters

Comments

TopNew
1
CodeLongAndPros
CodeLongAndPros

Please add a function to give the total computation time.

2 years ago
1
codeitfast
codeitfast

@CodeLongAndPros
Okay...Does python have a timer function?

2 years ago
1
codeitfast
codeitfast

@CodeLongAndPros
nevermind, I'll use threading. 😁

2 years ago
1
CodeLongAndPros
CodeLongAndPros

@codeitfast
You can use :

from time import time start = time() sleep(10) elasped = time.time() - start
2 years ago
1
CodeLongAndPros
CodeLongAndPros

Cool, but repl does not run your code on your computer. It runs it on repl's computers.

So even if I have a AMD threadripper, it will run the same speed as a Celeron.

2 years ago
1
codeitfast
codeitfast

@CodeLongAndPros
I actually started this on IDLE. I was trying to find the millionth prime number, but my computer is REALLY slow :( . I decided to try it on repl.it, since, chances are, it is many computers threaded together, so I would think it would be faster.

2 years ago
1
codeitfast
codeitfast

@CodeLongAndPros
what is an AMD threadripper? (I am new to repl.it and most coding aspects) Also, what is a Celeron?

2 years ago
1
CodeLongAndPros
CodeLongAndPros

@codeitfast
They are processors (CPU's)

2 years ago
1
codeitfast
codeitfast

@DynamicSquid
Wow! how did you find this so quickly? I literally just posted this, and didn't go on the share chat!

2 years ago
2
codeitfast
codeitfast

@DynamicSquid
Also, just wondering, on the chat feature, I noticed that repl.it said I only have 3 projects, and all of them aren't named. Do you have any idea of why that is?

2 years ago
1
DynamicSquid
DynamicSquid

@codeitfast
I get bored sometimes, so I just keep refreshing the tab. Also what do you mean by chat feature and unnamed projects?

2 years ago
1
codeitfast
codeitfast

@DynamicSquid
on the talk feature, when they say "+Add a post", they give you options of what repl you want to share. I already shared this one, so I thought it would be possible to add to the chat.

2 years ago
2
codeitfast
codeitfast

@DynamicSquid
but the only options that they gave were things like "TechnoVirusTree" or "RoundInvolvedPackage", which are some of my non-named projects.

2 years ago
1
DynamicSquid
DynamicSquid

@codeitfast
you have to search your projects up

2 years ago
1
Load more