Module: Easybench

Defined in:
lib/easybench.rb

Overview

BenchMark Everything

Defined Under Namespace

Classes: Benchmark, Suite

Constant Summary collapse

DEFAULT_ITERATIONS =
100000

Class Method Summary collapse

Class Method Details

.bm(options = {}, &block) ⇒ Object

Use :iterations => n to set n number of iterations (defaults to 100,000)



9
10
11
12
13
14
15
16
17
# File 'lib/easybench.rb', line 9

def bm(options = {}, &block)
  suite = Suite.new(options[:iterations] || 100000, &block)

  if options[:run] == false
    suite
  else
    suite.run
  end
end