Method: Benchmark::Report#item

Defined in:
lib/benchmark.rb

#item(label = "", *format, &blk) ⇒ Object Also known as: report

Prints the label and measured time for the block, formatted by format. See Tms#format for the formatting rules.



402
403
404
405
406
407
# File 'lib/benchmark.rb', line 402

def item(label = "", *format, &blk) # :yield:
  w = label.to_s.length
  @width = w if @width < w
  @list << res = Benchmark.measure(label, &blk)
  res
end