Version française
Home     About     Download     Resources     Contact us    
Browse thread
Waiting for float time
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Robert Roessler <roessler@r...>
Subject: Re: [Caml-list] Waiting for float time
sayan@crans.org wrote:
> I am looking for a floating point version of the function Unix.sleep in
> order to suspend execution of a program for 0.7s
> 
> Is there any such function in the standard library ?
> 
> Is there a solution outside of Threads, and GTK ?
> 
> I have looked at Unix.interval_timer but I'd rather not use it. From
> what I understand, you have to add a signal handler to catch sigalrm,
> and I do not see how to create a sleep function using it.
> 
> Is there a multiplatform solution ?

I believe the OCaml idiom for this is to use Unix.select with empty 
lists for all THREE of the descriptor lists... and this does work on 
Windows.

There may be better solutions... ;)

Robert Roessler
roessler@rftp.com
http://www.rftp.com