Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: sayan@crans.org
To: Caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Waiting for float time
Date: Thu, 28 Jun 2007 12:15:12 +0200	[thread overview]
Message-ID: <46838A30.5060904@crans.org> (raw)
In-Reply-To: <4682E2D9.4050207@rftp.com>

Robert Roessler wrote:
> 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... ;)
> 
Thanks for the suggestion, I would never have thought of polling for 
this. :)

What about wrapping usleep or nanosleep ? These are probably not 
portable, but are there obvious reasons not include them in the Unix 
library ?

-- 
Sébastien


  reply	other threads:[~2007-06-28 10:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-27 21:55 sayan
2007-06-27 22:11 ` [Caml-list] " Karl Zilles
2007-06-28 11:15   ` Matthieu Dubuget
2007-06-28 15:03     ` Bruno Verlyck, Bruno.Verlyck
2007-06-28 15:29       ` Matthieu Dubuget
2007-06-28 15:57         ` Bruno Verlyck, Bruno.Verlyck
2007-06-27 22:21 ` Robert Roessler
2007-06-28 10:15   ` sayan [this message]
2007-06-28 10:18     ` Vincent Hanquez
2007-06-28 11:18       ` Bünzli Daniel
2007-06-28 11:33   ` Yaron Minsky
2007-06-29 10:17     ` Robert Roessler
2007-06-28 12:50 ` Thomas Fischbacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46838A30.5060904@crans.org \
    --to=sayan@crans.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox