pocketlang/test/benchmark/fib/fib.py
2021-05-27 15:38:33 +05:30

11 lines
204 B
Python

from time import process_time as clock
def fib(n):
if n < 2: return n
return fib(n - 1) + fib(n - 2)
start = clock()
for i in range(0, 10):
print(fib(32))
print("elapsed: ", clock() - start, 's')