Skip to content

Instantly share code, notes, and snippets.

Created February 21, 2011 14:08
Show Gist options
  • Save anonymous/837095 to your computer and use it in GitHub Desktop.
Save anonymous/837095 to your computer and use it in GitHub Desktop.
--- bench/bench_fib_recursive.rb 2011-01-14 17:40:43.000000000 -0600
+++ bench_fib_recursive.rb 2011-02-21 08:05:51.000000000 -0600
@@ -4,10 +4,14 @@
if n < 2
n
else
- fib_ruby(n - 2) + fib_ruby(n - 1)
+ fib_ruby2(n - 2) + fib_ruby2(n - 1)
end
end
+def fib_ruby2(n)
+ fib_ruby(n)
+end
+
TIMES = (ARGV[0] || 5).to_i
N = (ARGV[1] || 30).to_i
TIMES.times {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment