# Ruby 2.5.1 # ----- Result ------ # Normal: 0.0035529999986465555s # Exception: 0.08799100000032922s # Exception/Normal: 24.765268796467108 # Catch&Throw: 0.027447000000393018s # Catch&Throw/Normal: 7.725021111975346 require 'benchmark' exception_result = Benchmark.realtime do |b| 100000.times do begin raise rescue end end end normal_result = Benchmark.realtime do |b| 100000.times do end end throw_result = Benchmark.realtime do |b| 100000.times do catch :test do throw :test end end end p "Normal: #{normal_result}s" p "Exception: #{exception_result}s" p "Exception/Normal: #{exception_result/normal_result}" p "Catch&Throw: #{throw_result}s" p "Catch&Throw/Normal: #{throw_result/normal_result}"