// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
@groovy.transform.CompileStatic
int fib(int n) {
    return n < 2 ? n : fib(n - 1) + fib(n - 2)
}

t0 = System.currentTimeMillis()
ans = fib(40)
t1 = System.currentTimeMillis()
println("fib(40) = ${ans} took ${(t1 - t0) / 1000.0} seconds.")
