3 ms·
That’s similar to Crystal. All numbers have built in methods to convert them to a Time::Span object. So I could have a function that takes a Time::Span instead
by devmunchies 5y ago
That’s similar to Crystal. All numbers have built in methods to convert them to a Time::Span object.
So I could have a function that takes a Time::Span instead of an Int, like:
def sleep(num : Time::Span)
# do something here
end
I would call it like:
sleep 300.seconds