def benchmark(caption, out_stream = $stdout, &block)
    return_value = nil
    bm = Benchmark.measure { return_value = block.call }
    out_stream << bm.to_s.chomp << ": #{caption}\n"
    return_value
  end
def benchmark(caption, out_stream = $stdout, &block)
    return_value = nil
    bm = Benchmark.measure { return_value = block.call }
    out_stream << bm.to_s.chomp << ": #{caption}\n"
    return_value
  end
Executes the passed block with the Ruby Benchmark standard library.
 Prints the benchmark string to the specified output stream.
 Returns the passed block's return value.

 e.g.   benchmark('time to loop 1,000,000 times') { 1_000_000.times { 42 }; 'hi' }
 outputs the following string:
   0.050000   0.000000   0.050000 (  0.042376): time to loop 1,000,000 times
  and returns: 'hi'

 @param caption the text fragment to print after the timing data
 @param out_stream object responding to << that will get the output string
   defaults to $stdout
 @block the block to execute and benchmark