# Wait in ruby

**URL:** <https://rubytalk.org/t/wait-in-ruby/4772>\
**Category:** ruby-talk\
**Created:** [17 February 2003 16:05 UTC](https://rubytalk.org/t/wait-in-ruby/4772 "2003-02-17T16:05:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anbieter\_99](https://avatars.discourse-cdn.com/v4/letter/a/cdc98d/32.png) [@Anbieter\_99](https://rubytalk.org/u/Anbieter_99)\
**Post date:** [17 February 2003 16:05 UTC](https://rubytalk.org/t/wait-in-ruby/4772/1 "2003-02-17T16:05:16Z")

</div>

Hi,

next question from me 🙂

Is there a possibility to say ruby wait for exact 5m and then go on?

Thanks

Gustav

---

<div class="post-metadata">

**Author:** ![ts1](https://avatars.discourse-cdn.com/v4/letter/t/a8b319/32.png) [@ts1](https://rubytalk.org/u/ts1)\
**Post date:** [17 February 2003 16:10 UTC](https://rubytalk.org/t/wait-in-ruby/4772/2 "2003-02-17T16:10:34Z")

</div>

> Is there a possibility to say ruby wait for exact 5m and then go on?

Kernel::sleep

pigeon% ri Kernel::sleep  
---------------------------------------------------------- Kernel::sleep  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep( [aNumeric] ) -\> aFixnum

> **···**
>
> ------------------------------------------------------------------------  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Suspends the current thread for aNumber seconds (which may be a  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Float with fractional seconds). Returns the actual number of  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;seconds slept (rounded), which may be less than that asked for if  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the thread was interrupted by a SIGALRM, or if another thread calls  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thread#run. An argument of zero causes sleep to sleep forever.  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Time.new #=\> Sun Mar 04 23:30:41 CST 2001  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep 1.2 #=\> 2  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Time.new #=\> Sun Mar 04 23:30:43 CST 2001  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep 1.9 #=\> 2  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Time.new #=\> Sun Mar 04 23:30:45 CST 2001
> 
> pigeon%
> 
> Guy Decoux
