rbm lets you benchmark varies code fragments by running them a specified number of times along with code fragments before and after all of the fragments or an individual fragment. See rbm --help for more information.
Samuel Kadolph
gem "rbm", "~> 1.0.1"