AST
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

17 lines
346 B

fun f(n) { if (n < 2) 1 else 1 + f(n-1) + f(n-2) }
start = microseconds();
n = f(30);
print(n, "\n");
time = microseconds() - start;
secs = time / 1000000;
usec = String(time % 1000000);
while (length(usec) < 6) usec = "0"+usec;
print(secs, ".", usec, " seconds\n");
print(n * 1000 / (time / 1000), " function calls per second\n");