From: Tomas Pospisek's Mailing Lists Date: 2007-03-02T07:57:06+09:00 Subject: Re: replacing the use of gettimeofday in the scheduler On Thu, 1 Mar 2007, Tomas Pospisek's Mailing Lists wrote: > Um. When I do a "timeout(5) { do_something };" and set the system clock back > by a minute, then the timeout will not *ever* time out. Correction, sorry - it will sleep 1 minute + 5 seconds, so... > >>> But: >>> >>> $ ri Kernel#sleep >>> >>> Suspends the current thread for _duration_ seconds (which may be >>> any number, including a +Float+ with fractional seconds). Returns >>> the actual number of seconds slept (rounded), which may be less >>> than that asked for if another thread calls +Thread#run+. Zero >>> arguments causes +sleep+ to sleep forever. >>> >>> No reference to wall-clock in there. What do you mean by "defined in terms >>> of the wall-clock"? >> >> When I write "sleep 5" I expect at least five seconds on the clock on my >> wall to go by before the next statement is executed. > > That's right, However this will not happen, when you change the system time > while the 5 seconds have not gone by. ... it will not sleep as long as the wall-clock. I.e. will not do what I expect. *t -- ----------------------------------------------------------- Tomas Pospisek http://sourcepole.com - Linux & Open Source Solutions -----------------------------------------------------------