about summary refs log tree commit diff
path: root/users/tazjin/rlox/examples/slow.lox
diff options
context:
space:
mode:
Diffstat (limited to 'users/tazjin/rlox/examples/slow.lox')
-rw-r--r--users/tazjin/rlox/examples/slow.lox9
1 files changed, 9 insertions, 0 deletions
diff --git a/users/tazjin/rlox/examples/slow.lox b/users/tazjin/rlox/examples/slow.lox
new file mode 100644
index 000000000000..dd6fb5e4bf4d
--- /dev/null
+++ b/users/tazjin/rlox/examples/slow.lox
@@ -0,0 +1,9 @@
+fun fib(n) {
+  if (n < 2) return n;
+  return fib(n - 1) + fib(n - 2);
+}
+
+var before = clock();
+print fib(40);
+var after = clock();
+print after - before;