Sha256: edeefaab4a4638643e7f5f22afafff14fe375dd789630697695ddb6b16673a94

Contents?: true

Size: 392 Bytes

Versions: 20

Compression:

Stored size: 392 Bytes

Contents

module CypressRails
  class Server
    class Timer
      def initialize(expire_in)
        @start = current
        @expire_in = expire_in
      end

      def expired?
        current - @start >= @expire_in
      end

      def stalled?
        @start == current
      end

      private

      def current
        Process.clock_gettime(Process::CLOCK_MONOTONIC)
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
cypress-rails-0.8.0.rc1 lib/cypress-rails/server/timer.rb
cypress-rails-0.7.1 lib/cypress-rails/server/timer.rb
cypress-rails-0.7.0 lib/cypress-rails/server/timer.rb
cypress-rails-0.6.1 lib/cypress-rails/server/timer.rb
cypress-rails-0.6.0 lib/cypress-rails/server/timer.rb
cypress-rails-0.5.5 lib/cypress-rails/server/timer.rb
cypress-rails-0.5.4 lib/cypress-rails/server/timer.rb
cypress-rails-0.5.3 lib/cypress-rails/server/timer.rb
cypress-rails-0.5.2 lib/cypress-rails/server/timer.rb
cypress-rails-0.5.1 lib/cypress-rails/server/timer.rb
cypress-rails-0.5.0 lib/cypress-rails/server/timer.rb
cypress-rails-0.4.2 lib/cypress-rails/server/timer.rb
cypress-rails-0.4.1 lib/cypress-rails/server/timer.rb
cypress-rails-0.4.0 lib/cypress-rails/server/timer.rb
cypress-rails-0.3.0 lib/cypress-rails/server/timer.rb
cypress-rails-0.2.0 lib/cypress-rails/server/timer.rb
cypress-rails-0.1.5 lib/cypress-rails/server/timer.rb
cypress-rails-0.1.4 lib/cypress-rails/server/timer.rb
cypress-rails-0.1.3 lib/cypress-rails/server/timer.rb
cypress-rails-0.1.2 lib/cypress-rails/server/timer.rb