Files
RubyMotion/test/Benchmark/app/benchmark/rational/divide.rb
2014-01-13 02:02:37 +09:00

22 lines
308 B
Ruby

def rational_divide(x)
rat1 = Rational(3, 2.5)
rat2 = Rational(3, 4)
x.report "/ Rational" do
500000.times do
rat1 / rat2
end
end
x.report "/ Fixnum" do
500000.times do
rat1 / 10
end
end
x.report "/ Float" do
500000.times do
rat1 / 4.5
end
end
end