Forum: Ruby delay

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
8aafedcf44e49905528db92dce034879?d=identicon&s=25 TURK (Guest)
on 2006-03-11 15:25
HI masters,
I want to create a loop say :

while (i>=0)
 // do something
 Now hang for two seconds for next iteration

How would you hang the process in ruby for a certain time?
thank you
9358cc96c46055cd68d4a76a9aefe026?d=identicon&s=25 Daniel Harple (Guest)
on 2006-03-11 15:29
(Received via mailing list)
On Mar 11, 2006, at 3:25 PM, TURK wrote:

> thank you
> --
> Posted via

Use Kernel#sleep

-- Daniel
This topic is locked and can not be replied to.