|
|
@ -1,14 +1,14 @@ |
|
|
|
import matplotlib.pyplot as plt |
|
|
|
import time |
|
|
|
from fibonacci import Fibonacci as fib |
|
|
|
import Fibonacci as fib |
|
|
|
|
|
|
|
|
|
|
|
def measureTime(n): |
|
|
|
|
|
|
|
total = 0 |
|
|
|
for i in range(0, 200): |
|
|
|
for i in range(0, 200000): |
|
|
|
start_time = time.time() |
|
|
|
fib.fibPower(n) |
|
|
|
fib.fibClosedFormula(n) |
|
|
|
end_time = time.time() |
|
|
|
total += end_time - start_time |
|
|
|
return total/200 |
|
|
@ -18,7 +18,7 @@ def generateData(): |
|
|
|
time = [] |
|
|
|
input = [] |
|
|
|
|
|
|
|
for i in range(1, 2000, 20): |
|
|
|
for i in range(1, 1000, 20): |
|
|
|
input.append(i) |
|
|
|
time.append(measureTime(i)) |
|
|
|
return input, time |
|
|
|