diff options
Diffstat (limited to 'ruby_2_2/benchmark/bm_app_factorial.rb')
-rw-r--r-- | ruby_2_2/benchmark/bm_app_factorial.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ruby_2_2/benchmark/bm_app_factorial.rb b/ruby_2_2/benchmark/bm_app_factorial.rb new file mode 100644 index 0000000000..45f471dfdb --- /dev/null +++ b/ruby_2_2/benchmark/bm_app_factorial.rb @@ -0,0 +1,11 @@ +def fact(n) + if(n > 1) + n * fact(n-1) + else + 1 + end +end + +100.times { + fact(5000) +} |