0

I am trying to write program in ruby which needs to make a pause before returning text.
In python you can do this by importing time and then using time.sleep(x). How would one go about doing this in ruby.

Ex. in Python
print ("you say hello")
time.sleep(5)
print ("I say goodbye")

vzg100
  • 13
  • 2
  • I searched for something similar to the title of my question "time.sleep ruby". Since I did not think to search for "Ruby wait" I did not see the original question. Thanks for pointing this out. – vzg100 Jul 02 '13 at 20:54
  • when I search "time.sleep ruby" or "sleep ruby" or "wait ruby" the question that I linked to is always the first or second page... – feralin Jul 02 '13 at 20:56
  • when I search "time.sleep ruby" I get 9 results (including mine). None of which show the original answer you posted. However "sleep ruby" shows the original question at the top of the page. Like I said I searched time.sleep ruby so I would not have seen the link you posted. – vzg100 Jul 02 '13 at 21:04

1 Answers1

2

For your example, just use

sleep(5)
Racso
  • 2,310
  • 1
  • 18
  • 23