delay

T

TURK

HI masters,
I want to create a loop say :

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

How would you hang the process in ruby for a certain time?
thank you
 
D

Daniel Harple

HI masters,
I want to create a loop say :

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

How would you hang the process in ruby for a certain time?
thank you

Use Kernel#sleep

-- Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top