Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Thread.delay,, 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.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 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 Archives:
Bug reports: FAQ:
Beginner's list: