Skip to content

Instantly share code, notes, and snippets.

@jendiamond
Created June 6, 2014 04:58
Show Gist options
  • Save jendiamond/c149e4bd75cf08e29332 to your computer and use it in GitHub Desktop.
Save jendiamond/c149e4bd75cf08e29332 to your computer and use it in GitHub Desktop.

benchmark

size b / Josh

$ irb 2.1.2 :001 > require 'benchmark' => true

The Benchmark module provides methods to measure and report the time used to execute Ruby code.( Used to measure the time to run ruby code within a block.

The benchmark offers a report and bm method which both take a block and return different types of runtimes.

http://www.ruby-doc.org/stdlib-1.9.3/libdoc/benchmark/rdoc/Benchmark.html http://blogs.burnsidedigital.com/2012/10/basic-benchmarking-in-ruby/ http://www.infoq.com/news/2008/06/introducing-ruby-benchmark-suite http://books.google.com/books?id=A78bYfzYKZ4C&pg=PA196&lpg=PA196&dq=ruby+standard+library+benchmark&source=bl&ots=vGcigkq8FJ&sig=uWy8DRF6Kbdlbci5SRV7l6U57Xo&hl=en&sa=X&ei=1Y92U5bTGs2FogT41YHgDg&ved=0CHMQ6AEwCA#v=onepage&q=ruby%20standard%20library%20benchmark&f=false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment