Cross Reference: bm_app_factorial.rb
xref
: /
macosx-10.9.5
/
ruby-104
/
ruby
/
benchmark
/
bm_app_factorial.rb
Home
History
Annotate
Line#
Navigate
Raw
Download
only in
/macosx-10.9.5/ruby-104/ruby/benchmark/
1
def
fact
(n)
2
if
(n >
1
)
3
n *
fact
(n-
1
)
4
else
5
1
6
end
7
end
8
9
100.times
{
10
fact
(
5000
)
11
}
12