Sha256: bed9f4ec19f117b8d071ce492146ee58730a780be95b47822d285df82695f719
Contents?: true
Size: 368 Bytes
Versions: 6
Compression:
Stored size: 368 Bytes
Contents
module Specs def self.sleep_and_wait_until(timeout = 10) t1 = Time.now.to_f ::Timeout.timeout(timeout) do loop until yield end diff = Time.now.to_f - t1 STDERR.puts "wait took a bit long: #{diff} seconds" if diff > Specs::TIMER_QUANTUM rescue Timeout::Error t2 = Time.now.to_f raise "Timeout after: #{t2 - t1} seconds" end end
Version data entries
6 entries across 6 versions & 1 rubygems