13 lines
201 B
Plaintext
13 lines
201 B
Plaintext
|
// A recursive implementation of the fibonacci sequence
|
||
|
|
||
|
fun fib(n) {
|
||
|
if (n <= 1) return n;
|
||
|
return fib(n - 2) + fib(n - 1);
|
||
|
}
|
||
|
|
||
|
|
||
|
var start = clock();
|
||
|
fib(30);
|
||
|
var end = clock() - start;
|
||
|
print(end);
|