Skip to content
Sign upLog in
← Back to Community

prime number generator

Profile icon
codeitfastHacker

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!

Voters
Profile icon
userSM
Profile icon
HenryZelonka1
Profile icon
codeitfast
Profile icon
DynamicSquid
Comments
hotnewtop
Profile icon
CodeLongAndPros

Please add a function to give the total computation time.

Profile icon
codeitfast

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

Profile icon
codeitfast

@CodeLongAndPros
nevermind, I'll use threading. 😁

Profile icon
CodeLongAndPros

@codeitfast
You can use :

from time import time start = time() sleep(10) elasped = time.time() - start
Profile icon
codeitfast

@CodeLongAndPros
Ohhhhh. Fixed it!

Profile icon
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.

Profile icon
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.

Profile icon
codeitfast

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

Profile icon
CodeLongAndPros

@codeitfast
They are processors (CPU's)

Profile icon
DynamicSquid

cool

Profile icon
codeitfast

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

Profile icon
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?

Profile icon
DynamicSquid

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

Profile icon
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.

Profile icon
codeitfast

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

Profile icon
DynamicSquid

@codeitfast
you have to search your projects up

Profile icon
codeitfast

@DynamicSquid
oh...Just saw it 😳