mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-09 15:08:08 -05:00
16 lines
222 B
Ruby
Executable File
16 lines
222 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
require 'benchmark/ips'
|
|
|
|
def fast
|
|
yield
|
|
end
|
|
|
|
def slow(&block)
|
|
block.call
|
|
end
|
|
|
|
Benchmark.ips do |x|
|
|
x.report('yield') { fast { (0..9).to_a } }
|
|
x.report('block.call') { slow { (0..9).to_a } }
|
|
end
|