Sha256: 03b48f160acec59e0e3b6597ac0e885945ad9c011c75d762a5b0fd2018bbcf5c

Contents?: true

Size: 283 Bytes

Versions: 32

Compression:

Stored size: 283 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

32 entries across 32 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/util/watcher/timer.rb
puppet-8.10.0-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.10.0-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.10.0-universal-darwin lib/puppet/util/watcher/timer.rb
puppet-8.9.0 lib/puppet/util/watcher/timer.rb
puppet-8.9.0-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.9.0-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.9.0-universal-darwin lib/puppet/util/watcher/timer.rb
puppet-8.8.1 lib/puppet/util/watcher/timer.rb
puppet-8.8.1-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.8.1-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.8.1-universal-darwin lib/puppet/util/watcher/timer.rb
puppet-8.7.0 lib/puppet/util/watcher/timer.rb
puppet-8.7.0-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.7.0-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.7.0-universal-darwin lib/puppet/util/watcher/timer.rb
puppet-8.6.0 lib/puppet/util/watcher/timer.rb
puppet-8.6.0-x86-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.6.0-x64-mingw32 lib/puppet/util/watcher/timer.rb
puppet-8.6.0-universal-darwin lib/puppet/util/watcher/timer.rb