The benchmark takes a block and returns the time:
http://ruby-doc.org/stdlib-1.9.3/libdoc/benchmark/rdoc/Benchmark.html
require 'benchmark'
puts Benchmark.measure { "a"*1_000_000 }
What if you want to benchmark an operation and get both the return value and the elapsed time?
Or, stated another way, can a closure modify an object passed into it?
A closure can modify objects in its scope, like this: