From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Sun, 22 Mar 2009 20:54:44 -0400 To: 9fans@9fans.net Message-ID: <8755fbe09f6563d841971b95f67e365f@coraid.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] fossil periodic thread does zero sleep() Topicbox-Message-UUID: c20b98a8-ead4-11e9-9d60-3106f5b1d025 > The problem is that when sleep is a little bit too fast on every round, > t will never catch up with ct. so it sleeps shorter and shorter until > t - ct < 1. > > It all works when changing t += msec to t = ct + msec. It may still > do a zero sleep, but the error will not add up. why not just get rid of the double? then you will never zero sleep. - erik