An array of 2-element arrays, consisting of label and block pairs.
# File lib/benchmark/ips.rb, line 107 def initialize @list = [] @compare = false end
# File lib/benchmark/ips.rb, line 114 def compare! @compare = true end
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