Class: Puppet::Util::Profiler::WallClock::Timer Private
- Defined in:
- lib/puppet/util/profiler/wall_clock.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- FOUR_DECIMAL_DIGITS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'%0.4f'
Instance Method Summary collapse
-
#initialize ⇒ Timer
constructor
private
A new instance of Timer.
- #stop ⇒ Object private
- #to_s ⇒ Object private
Constructor Details
#initialize ⇒ Timer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Timer.
21 22 23 |
# File 'lib/puppet/util/profiler/wall_clock.rb', line 21 def initialize @start = Time.now end |
Instance Method Details
#stop ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 28 |
# File 'lib/puppet/util/profiler/wall_clock.rb', line 25 def stop @time = Time.now - @start @time end |
#to_s ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/puppet/util/profiler/wall_clock.rb', line 30 def to_s format(FOUR_DECIMAL_DIGITS, @time) end |