In Shoes, the animate method repeats an action every so-and-so times a second:
frequency = 100 # Hertz
animate frequency do
do_something
end
What if, however, I want to repeat an action once every ten minutes?
Specifically, I want my weather program to check the weather every so
often automatically. I can't do this with animate(): animate() only
takes integers, which means it can only repeat something with a cycle
period of less than or equal to one second.
Would it possible to implement a method that repeats an action less
often than a second? Like this:
period = 1800 # seconds
repeat_every period do
update_weather
end
Sincerely,
Joshua Choi