pocketlang/test/benchmark/fib/fib.wren
Thakee Nathees df93b2c1ec gc bugs fixed
- popping operands from the stack was too early -fixed
- some temproary string objects weren't pushed to the vm's temp root
  -fixed
- and some minor bug fixed
2021-05-23 23:25:04 +05:30

12 lines
218 B
Plaintext

class Fib {
static get(n) {
if (n < 2) return n
return get(n - 1) + get(n - 2)
}
}
var start = System.clock
for (i in 0..10) {
System.print(Fib.get(28))
}
System.print("elapsed: %(System.clock - start)")