Sha256: c4a0962c0fb6d6e86e7e27547e1ee9fee46dd158b07f52a7c415a9699ee2b898

Contents?: true

Size: 335 Bytes

Versions: 9

Compression:

Stored size: 335 Bytes

Contents

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

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

      private

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
derail_specs-0.7.0 lib/derail_specs/server/timer.rb
derail_specs-0.6.1 lib/derail_specs/server/timer.rb
derail_specs-0.6.0 lib/derail_specs/server/timer.rb
derail_specs-0.5.1 lib/derail_specs/server/timer.rb
derail_specs-0.5.0 lib/derail_specs/server/timer.rb
derail_specs-0.4.0 lib/derail_specs/server/timer.rb
derail_specs-0.3.0 lib/derail_specs/server/timer.rb
derail_specs-0.2.1 lib/derail_specs/server/timer.rb
derail_specs-0.2.0 lib/derail_specs/server/timer.rb