Tell Ruby Program to Wait some amount of time

后端 未结 6 1332
渐次进展
渐次进展 2020-12-07 07:24

How do you tell a Ruby program to wait an arbitrary amount of time before moving on to the next line of code?

6条回答
  •  不知归路
    2020-12-07 08:00

    sleep 6 will sleep for 6 seconds. For a longer duration, you can also use sleep(6.minutes) or sleep(6.hours).

提交回复
热议问题