ruby--ruby/benchmark/bm_app_factorial.rb

11 lines
89 B
Ruby

def fact(n)
if(n > 1)
n * fact(n-1)
else
1
end
end
8.times{
fact(5000)
}