kernel/common/kernel.rb
#
# Sleeps the current thread for +duration+ seconds.
#
Sleeps the current thread for +duration+ seconds.
Sleeps the current thread for + duration + seconds .
def sleep(duration=Undefined)
    if duration.equal? Undefined
      duration = nil
    elsif !duration.kind_of?(Numeric)
      raise TypeError, 'time interval must be a numeric value'
    end
    start = Process.time
    chan = Channel.new
    chan.receive_timeout duration
    return Process.time - start
  end
def sleep ( duration = Undefined ) if duration . equal? Undefined duration = nil elsif ! duration . kind_of? ( Numeric ) raise TypeError , 'time interval must be a numeric value' end start = Process . time chan = Channel . new chan . receive_timeout duration return Process . time - start end
Sleeps the current thread for +duration+ seconds.
Sleeps the current thread for + duration + seconds .
duration
<not_specific>