mirror of
https://github.com/zekexiao/pocketlang.git
synced 2025-02-06 12:46:53 +08:00
15 lines
196 B
Plaintext
15 lines
196 B
Plaintext
|
|
||
|
os = import('os')
|
||
|
|
||
|
def fib(n)
|
||
|
if n < 2 do return 1 end
|
||
|
return fib(n - 1) + fib(n - 2)
|
||
|
end
|
||
|
|
||
|
start = os.clock()
|
||
|
for i in 0..10
|
||
|
print(fib(28))
|
||
|
end
|
||
|
print('elapsed: ', os.clock() - start, 's')
|
||
|
|