Ruby 1.9.0 リファレンスマニュアル > ライブラリ一覧 > library _builtin > module Kernel > sleep
sleep(sec = 0) -> Integersec 秒だけプログラムの実行を停止します。
sec が省略されたり 0 を指定した場合、他スレッドからの Thread#run などで明示的に起こさない限り永久にスリープします。Thread#runを呼ぶとその時点で sleepの実行が中断されます。
it = Thread.new do sleep 999 puts 'it_end' end re = sleep 2.11 puts re it.run re2 = sleep 0.76 puts re2 #=> 2 # it_end # 1