class Benchmark::Job
:nodoc:
Benchmark.bmbm method. It is of little direct interest to the user.
A Job is a sequence of labelled blocks to be processed by the
def initialize(width)
the #bmbm method passes its +width+ argument to this constructor.
+width+ is a initial value for the label offset used in formatting;
Job objects are created by the #bmbm method.
Usually, one doesn't call this method directly, as new
Returns an initialized Job instance.
:nodoc:
Benchmark.bmbm method. It is of little direct interest to the user.
A Job is a sequence of labelled blocks to be processed by the
def initialize(width) @width = width @list = [] end
def item(label = "", &blk) # :yield:
Registers the given label and block pair in the job list.
def item(label = "", &blk) # :yield: raise ArgumentError, "no block" unless block_given? label = label.to_s w = label.length @width = w if @width < w @list << [label, blk] self end