Tasmota/lib/libesp32/Berry/examples/fib_rec.be

13 lines
208 B
Python
Raw Normal View History

2021-04-12 18:53:35 +01:00
import time
def fib(x)
if x <= 2
return 1
end
return fib(x - 1) + fib(x - 2)
end
c = time.clock()
print("fib:", fib(38)) # minimum stack size: 78!!
print("time:", time.clock() - c, 's')