Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'benchmark'
- total = (ENV['TOTAL'] || 1000000).to_i
- Benchmark.bmbm do |x|
- x.report("'%d'") do
- total.times { sprintf('%d', 10) }
- end
- x.report("'Hello %s, from %4.2f'") do
- total.times { sprintf('Hello %s, from %4.2f', 'world', 123.4567) }
- end
- end
Add Comment
Please, Sign In to add comment