From: "Eric I." Date: 2008-02-22T00:44:57+09:00 Subject: Re: Timers and Alarms On Feb 21, 10:17 am, Hans Fugal wrote: > I want a program to wait for some moment in time, and resume operation > at that moment. sleep is ruled out because it just counts cycles and is > thrown off when my laptop suspends. What about a roll-your-own solution like: def my_sleep(interval, granularity = 60) end_time = Time.now + interval remaining = end_time - Time.now while granularity < remaining sleep granularity remaining = end_time - Time.now end sleep remaining end Even if you close your laptop, when you finally wake it, the timer will end within granularity seconds. Eric ---- Are you interested in on-site Ruby training that uses well-designed, real-world, hands-on exercises? http://LearnRuby.com