class Benchmark::IPSJob

Attributes

compare[R]
list[R]

An array of 2-element arrays, consisting of label and block pairs.

Public Class Methods

new() click to toggle source
# File lib/benchmark/ips.rb, line 107
def initialize
  @list = []
  @compare = false
end

Public Instance Methods

compare!() click to toggle source
# File lib/benchmark/ips.rb, line 114
def compare!
  @compare = true
end
item(label="", str=nil) { || ... } click to toggle source

Registers the given label and block pair in the job list.

# File lib/benchmark/ips.rb, line 121
def item(label="", str=nil, &blk) # :yield:
  if blk and str
    raise ArgumentError, "specify a block and a str, but not both"
  end

  action = str || blk
  raise ArgumentError, "no block or string" unless action

  @list.push Entry.new(label, action)
  self
end
Also aliased as: report
report(label="", str=nil)
Alias for: item