Class: Puppet::Util::Profiler::Aggregate::Timer

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/util/profiler/aggregate.rb

Instance Method Summary collapse

Constructor Details

#initializeTimer

Returns a new instance of Timer.



74
75
76
# File 'lib/puppet/util/profiler/aggregate.rb', line 74

def initialize
  @start = Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_second)
end

Instance Method Details

#stopObject



78
79
80
# File 'lib/puppet/util/profiler/aggregate.rb', line 78

def stop
  Process.clock_gettime(Process::CLOCK_MONOTONIC, :float_second) - @start
end