init
This commit is contained in:
28
measure.py
Normal file
28
measure.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import simplefindprime as s, mediumfindprime as m, hardfindprime as h
|
||||
|
||||
message = "Time to run program: "
|
||||
tests = 25
|
||||
test_num = 1000
|
||||
simpletime = 0
|
||||
medtime = 0
|
||||
hardtime = 0
|
||||
|
||||
for i in range(0, tests):
|
||||
print("Test: " + str(i + 1))
|
||||
simpletime += s.findxprimes(test_num)[1]
|
||||
medtime += m.findxprimes(test_num)[1]
|
||||
hardtime += h.findxprimes(test_num)[1]
|
||||
|
||||
simpletime /= tests
|
||||
medtime /= tests
|
||||
hardtime /= tests
|
||||
|
||||
print()
|
||||
print(message + str(simpletime))
|
||||
print(message + str(medtime))
|
||||
print(message + str(hardtime))
|
||||
|
||||
print()
|
||||
print("efficiency of medium vs simple: " + str(int(round(1/(medtime/simpletime),0))) + "x")
|
||||
print("efficiency of hard vs medium: " + str(int(round(1/(hardtime/medtime), 0))) + "x")
|
||||
print("efficiency of hard vs simple: " + str(int(round(1/(hardtime/simpletime), 0))) + "x")
|
||||
Reference in New Issue
Block a user