From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA23528; Mon, 9 Jun 2003 18:19:10 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA23811 for ; Mon, 9 Jun 2003 18:19:09 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h59GJ8H24469; Mon, 9 Jun 2003 18:19:08 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA23959; Mon, 9 Jun 2003 18:19:08 +0200 (MET DST) Date: Mon, 9 Jun 2003 18:19:08 +0200 From: Xavier Leroy To: Nick Name Cc: caml-list@inria.fr Subject: Re: [Caml-list] Thread.delay, Unix.select, Unix.gettimeofday, Sys.time together? Message-ID: <20030609181908.C22874@pauillac.inria.fr> References: <20030607141702.28d583c6.nick.name@inwind.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20030607141702.28d583c6.nick.name@inwind.it>; from nick.name@inwind.it on Sat, Jun 07, 2003 at 02:17:02PM +0200 X-Spam: no; 0.00; caml-list:01 gettimeofday:01 shorter:01 kernels:01 tree:02 exception:02 unix:02 thread:02 sys:03 dev:04 source:07 alpha:07 i'm:07 function:09 linux:09 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > If I put the delay into the cycle, I can't get less than 1/100 of second > delay, on any machine I do this test. Is there a portable function that > can do a shorter delay, say 1/1000 of second ad least? Not in a portable way, I'm afraid. Most Unix kernels round delays up to the next clock tick, and use clocks of 50, 60 or 100 Hz. Linux/Alpha is an exception, with a 1000 Hz (or 1024?) clock. Under Linux, you could use Unix.select() on /dev/rtc. This device can be programmed to generate ticks with a frequency between 1 Hz and 8192 Hz in powers of 2. Check Documentation/rtc.txt in the Linux source tree for more details. - Xavier Leroy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners