How to produce delay in ruby?
I used sleep statement but it didn't give me what I want.
puts "amit"
sleep(10)
puts "scj"
I want it to first print amit, then a delay of 10 seconds, then print scj.
But in above case what happens is it will pause for 10 seconds and then it will print amit and scj together. I don't want that.
I hope you got what I want to say.
puts 'bla'; sleep(10); puts '...and continue!'
in irb, it justs works. Please explain more what your context is. Platform, ruby-version, maybe a small example ... – nathanvda Jun 21 '10 at 13:29