require 'benchmark/ips'
def fast
yield
end
def slow(&block)
block.call
Benchmark.ips do |x|
x.report('yield') { fast { (0..9).to_a } }
x.report('block.call') { slow { (0..9).to_a } }