lib/yui_rest_client/timer.rb
# Execute code block with the interval until timeout reached.
# @param timeout [Numeric] how many time in seconds to wait
# @param interval [Numeric] time in seconds between attempts
Execute code block with the interval until timeout reached.
Execute code block with the interval until timeout reached .
def wait(timeout, interval)
      return yield if timeout.zero?
      end_time = Time.now.to_f + timeout
      while Time.now.to_f <= end_time
        yield
        sleep interval
      end
    end
def wait ( timeout , interval ) return yield if timeout . zero? end_time = Time . now . to_f + timeout while Time . now . to_f <= end_time yield sleep interval end end
Execute code block with the interval until timeout reached.
Execute code block with the interval until timeout reached .
timeout
None
interval
time in seconds between attempts
time in seconds between attempts