class DiffBench::Bm

Public Class Methods

new(&block) click to toggle source
# File lib/diffbench/bm.rb, line 3
def initialize(&block)
  @measures = {}
  if block.arity == -1 || block.arity > 0
    block.call(self)
  else
    instance_eval(&block)
  end

  puts Encoder.encode(@measures)
end

Public Instance Methods

report(label) { || ... } click to toggle source
# File lib/diffbench/bm.rb, line 14
def report(label)
  @measures[label] = Benchmark.measure do
    yield
  end
end