This commit is contained in:
Reese Wells
2018-07-29 17:25:09 -04:00
commit 47c752ff65
6 changed files with 164 additions and 0 deletions

28
measure.py Normal file
View 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")