Reputation: 2304
I'm looking to use the delay method, but am unsure as to what unit of time the first argument is.
As a follow-up, is the argument an integer, float, or something else?
Upvotes: 1
Views: 134
Reputation: 4857
The implementation calls to_f
on the argument internally and interprets it as seconds, so you can pass anything that responds in a compatible way. This includes Time::Span instances, so things like delay(5.minutes) { puts "done" }
work.
Upvotes: 3
Reputation: 2304
The delay time is in seconds, and is a float (or other number type with decimal precision)
Upvotes: 1