From: Gregory Brown Date: 2005-11-04T04:25:07+09:00 Subject: Re: Continous running thread On 11/3/05, Caleb Tennis wrote: > > Sleep will round you to the nearest integer. > > > > Run sleep 1.4 and sleep 1.9 in irb and see what you get. > > It rounds its return value to the nearest integer, but at least here it sleeps > for the specified time. I just looked it up in the Pickaxe... you're right. It returns the time actually slept (rounded to the nearest second) and tries to sleep to the specified float time. http://www.rubycentral.com/book/ref_m_kernel.html#Kernel.sleep This is not meant to a precise I don't think, so this kind of round is fine. I once needed greater precision than sleep() but I forgot what I used. I am pretty sure there is something in the standard library for this, though. >