Simple Benchmarking : Benchmark « Development « Ruby





Simple Benchmarking


require 'benchmark'
puts Benchmark.measure { 10000.times { print "." } }

 

Related examples in the same category

1.Because measure accepts code blocks, you can make it as elaborate
2.Benchmark includes a way to make completing multiple tests more convenient.
3.Benchmark inline c
4.Benchmark reflection