[Unison-hackers] Unix.sleep insufficient for -repeat! Need half seconds.
Joseph Dunn
jdunn14 at hotpop.com
Fri Apr 20 18:59:10 EDT 2007
On Fri, 20 Apr 2007 11:54:33 -0400
Benjamin Pierce <bcpierce at cis.upenn.edu> wrote:
> I'd be very happy to see this change. Couple of thoughts:
>
> * One reason that usleep is not wrapped for OCaml might be (I don't
> know) that Win32 doesn't offer something comparable. Whatever
> solution is adopted here needs to at least compile cross-platform,
> even if the full functionality isn't available everywhere. And it
> needs to degrade in a graceful way.
>
The argument to the Windows Sleep() function is in milliseconds, so if
that's fine enough granularity for you then you can make a cross
platform millisecond sleep without much trouble. Alternatively, people
sometimes use calls to select() to do sub second timings, but it's not
the best way to go.
-Joseph
More information about the Unison-hackers
mailing list