Sha256: 6ba749490c48b14add39b5ef68a87916bfa543bde073794f0ddb46ee0753b6a3

Contents?: true

Size: 282 Bytes

Versions: 20

Compression:

Stored size: 282 Bytes

Contents

# frozen_string_literal: true
class Puppet::Util::Watcher::Timer
  attr_reader :timeout

  def initialize(timeout)
    @timeout = timeout
  end

  def start
    @start_time = now
  end

  def expired?
    (now - @start_time) >= @timeout
  end

  def now
    Time.now.to_i
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/util/watcher/timer.rb
puppet-8.3.0-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.3.0-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.3.0-universal-darwin lib/puppet/util/watcher/timer.rb
puppet-8.3.1 lib/puppet/util/watcher/timer.rb
puppet-8.3.1-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.3.1-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.3.1-universal-darwin lib/puppet/util/watcher/timer.rb
puppet-8.2.0 lib/puppet/util/watcher/timer.rb
puppet-8.2.0-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.2.0-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.2.0-universal-darwin lib/puppet/util/watcher/timer.rb
puppet-8.1.0 lib/puppet/util/watcher/timer.rb
puppet-8.1.0-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.1.0-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.1.0-universal-darwin lib/puppet/util/watcher/timer.rb
puppet-8.0.1 lib/puppet/util/watcher/timer.rb
puppet-8.0.1-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.0.1-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.0.1-universal-darwin lib/puppet/util/watcher/timer.rb