rubyx/test/bench/ruby/adds.rb
Torsten 6b1c316f04 add simple loop bench
fiddled with run numbers a bit
recording times with noop removed
results slightly worse than hoped
2019-07-31 21:18:03 +03:00

20 lines
206 B
Ruby

def fibo( n)
a = 0
b = 1
i = 1
while( i < n ) do
result = a + b
a = b
b = result
i+= 1
end
return result
end
counter = 50000
while(counter > 0) do
fibo(40)
counter -= 1
end