##Benchmark The benchmark module provides an easy way to time how long your Ruby code takes to run. In this example, I will use the bm method to generate sequential reports with labels.
This bit of code compares two different ways to concatenate strings. It times how long it takes to concatenate a period at the end of a string of 10,000 a's, one million times in a row. The label for the each test is passed into the report method.
require 'benchmark'
Benchmark.bm do |x|
# Test for concatenation with +=