Repository where I mostly put random python scripts.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

32 lines
573 B

import matplotlib.pyplot as plt
import time
import Fibonacci as fib
def measureTime(n):
total = 0
for i in range(0, 200000):
start_time = time.time()
fib.fibClosedFormula(n)
end_time = time.time()
total += end_time - start_time
return total/200
def generateData():
time = []
input = []
for i in range(1, 1000, 20):
input.append(i)
time.append(measureTime(i))
return input, time
data = generateData()
plt.plot(data[0], data[1])
plt.xlabel('Fibonacci Term')
plt.ylabel('Seconds')
plt.show()