Class: Benchmark::Report
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/benchmark.rb |
Overview
Class Method Summary
-
.new(width = 0, format = nil) ⇒ Report
constructor
Returns an initialized
Report
instance.
Instance Attribute Summary
Instance Method Summary
-
#item(label = "", *format, &blk)
(also: #report)
Prints the
label
and measured time for the block, formatted byformat
. -
#report(label = "", *format, &blk)
Alias for #item.
Constructor Details
.new(width = 0, format = nil) ⇒ Report
Returns an initialized Report
instance. Usually, one doesn’t call this method directly, as new Report
objects are created by the Benchmark#benchmark and Benchmark#bm methods. width
and format
are the label offset and format string used by Tms#format.
# File 'lib/benchmark.rb', line 369
def initialize(width = 0, format = nil) @width, @format, @list = width, format, [] end
Instance Attribute Details
#list (readonly)
An array of Tms
objects representing each item.
# File 'lib/benchmark.rb', line 388
attr_reader :list
Instance Method Details
#item(label = "", *format, &blk) Also known as: #report
Prints the label
and measured time for the block, formatted by format
. See Tms#format for the formatting rules.
#report(label = "", *format, &blk)
Alias for #item.
# File 'lib/benchmark.rb', line 385
alias report item