Date: Sun, 1 Aug 1999 12:06:18 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Pierre-André Mudry cc: djgpp AT delorie DOT com Subject: Re: usleep function problem.... In-Reply-To: <7o0261$3ci$1@news.interpoint.ch> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by delorie.com id HAA24224 Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 1 Aug 1999, Pierre-André Mudry wrote: > the function usleep() doesn't seem to work on the two computers I have. It > produces stranges results (e.g. when I convert delay(x) in usleep(x * 1000) > the result should be the same but they aren't). `usleep' and `delay' should certainly NOT produce the same effect. `delay' has a 1-millisecond granularity, while `usleep' has the basic 54-millisecond granularity of the system clock. > When the argument of usleep > is bigger than 10000 the delays are always the same and when under 10000 > there is no delay at all... This is expected behavior. Any argument less than 55000 will cause such strange effects. > What should I do ? I really need a better resolution than 1 ms.... Write your own loop using the function `uclock'. It has 800-nanosecond granularity.