Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Thread.delay, Unix.select, Unix.gettimeofday, Sys.time together?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] Thread.delay, Unix.select, Unix.gettimeofday, Sys.time together?
> 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