From 6a38600ce88bbf2d9fa9a3821d7df3ebd8e0d4f3 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 30 Aug 2021 19:15:05 +0300 Subject: chore(tazjin/rlox): Add some old code example files Change-Id: I484b11069286ea2277e9e158fa5c3bd34f84c89e Reviewed-on: https://cl.tvl.fyi/c/depot/+/3464 Tested-by: BuildkiteCI Reviewed-by: tazjin --- users/tazjin/rlox/examples/slow.lox | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 users/tazjin/rlox/examples/slow.lox (limited to 'users/tazjin/rlox/examples/slow.lox') 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; -- cgit 1.4.1