Method: Benchmark::Job#item
- Defined in:
- lib/benchmark.rb
#item(label = "", &blk) ⇒ Object Also known as: report
Registers the given label and block pair in the job list.
320 321 322 323 324 325 326 327 |
# File 'lib/benchmark.rb', line 320 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 |