Module: Reyes::Utils
- Includes:
- Chalk::Log
- Defined in:
- lib/reyes/utils.rb
Class Method Summary collapse
-
.sleep_random(max) ⇒ Object
Sleep a random number of seconds, at least zero and less than ‘max`.
Class Method Details
.sleep_random(max) ⇒ Object
Sleep a random number of seconds, at least zero and less than ‘max`.
8 9 10 11 12 |
# File 'lib/reyes/utils.rb', line 8 def self.sleep_random(max) delay = Random.rand(max) log.info("Sleeping #{delay} seconds -- chosen from [0, #{max})") sleep(delay) end |