AW: Re: clock-scheduled operations

Gesendet von meinem HTC

···

----- Ursprüngliche Nachricht -----
Von: Ryan Davis <ryand-ruby@zenspider.com>
Gesendet: Dienstag, 28. Juni 2011 21:05
An: ruby-talk ML <ruby-talk@ruby-lang.org>
Betreff: Re: clock-scheduled operations

On Jun 28, 2011, at 11:58 , Chad Perrin wrote:

Obviously, scheduling something to happen every foo seconds is easy.
What is a reasonably performant, simple way to schedule an operation to
occur at a particular time of day (preferably specified by a particular
time zone)?

The first thing that comes to my mind is checking Time.now, checking the
time between that and the desired time of day, then spawn a thread that
sleeps for that length of time (because I need the program to do other
things in the meantime). Is there a better way to do this?

cron