lib/polyphony/core/timer.rb
# Sleeps for the given duration.
#
# @param duration [Number] sleep duration in seconds
# @return [void]
Sleeps for the given duration.
Sleeps for the given duration .
def sleep(duration)
      fiber = Fiber.current
      @timeouts[fiber] = {
        interval: duration,
        target_stamp: now + duration
      }
      Polyphony.backend_wait_event(true)
    ensure
      @timeouts.delete(fiber)
    end
def sleep ( duration ) fiber = Fiber . current @timeouts [ fiber ] = { interval : duration , target_stamp : now + duration } Polyphony . backend_wait_event ( true ) ensure @timeouts . delete ( fiber ) end
Sleeps for the given duration.
Sleeps for the given duration .
None
void
duration
sleep duration in seconds
sleep duration in seconds