Wait in ruby

Hi,

next question from me :slight_smile:

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

Thanks

Gustav

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

Kernel::sleep

pigeon% ri Kernel::sleep
---------------------------------------------------------- Kernel::sleep
     sleep( [aNumeric] ) -> aFixnum

···

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

pigeon%

Guy Decoux