Class: Timer::Timer
- Inherits:
-
TimerGroup
- Object
- TimerNode
- TimerGroup
- Timer::Timer
- Defined in:
- lib/pg_graph/timer.rb
Instance Attribute Summary
Attributes inherited from TimerGroup
Attributes inherited from TimerNode
Instance Method Summary collapse
- #dump(file = $stdout) ⇒ Object
-
#initialize(label = nil, **opts) ⇒ Timer
constructor
A new instance of Timer.
Methods inherited from TimerGroup
#factor, #group, #time, #total
Methods inherited from TimerNode
#label_width, #total, #value_width
Constructor Details
#initialize(label = nil, **opts) ⇒ Timer
Returns a new instance of Timer.
107 108 109 |
# File 'lib/pg_graph/timer.rb', line 107 def initialize(label = nil, **opts) super(self, label, **opts) end |
Instance Method Details
#dump(file = $stdout) ⇒ Object
111 112 113 114 115 116 |
# File 'lib/pg_graph/timer.rb', line 111 def dump(file = $stdout) super if @nodes.size > 1 file.printf "%-#{label_width}s: %#{value_width}s#{timer.unit}\n", "Total", format(total) end end |