From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 770E1BC6E for ; Thu, 28 Jun 2007 00:21:28 +0200 (CEST) Received: from smtp103.sbc.mail.mud.yahoo.com (smtp103.sbc.mail.mud.yahoo.com [68.142.198.202]) by discorde.inria.fr (8.13.6/8.13.6) with SMTP id l5RMLQGu030078 for ; Thu, 28 Jun 2007 00:21:27 +0200 Received: (qmail 80376 invoked from network); 27 Jun 2007 22:21:25 -0000 Received: from unknown (HELO ?192.168.1.100?) (rftp@pacbell.net@69.230.222.200 with plain) by smtp103.sbc.mail.mud.yahoo.com with SMTP; 27 Jun 2007 22:21:25 -0000 X-YMail-OSG: weKxfAMVM1nDC0pjrOFouoGCHdEngXyu4PG_NHtYX0OT3Kh9vwVIKPNv53afk8mILmn0igkPeSVnmUqHuynPZzUDXdwtmw7eMDykJxuDbGLfNHfqTrc- Message-ID: <4682E2D9.4050207@rftp.com> Date: Wed, 27 Jun 2007 15:21:13 -0700 From: Robert Roessler User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a6pre) Gecko/20070626 SeaMonkey/2.0a1pre MIME-Version: 1.0 To: Caml-list Subject: Re: [Caml-list] Waiting for float time References: <4682DCDF.5000301@crans.org> In-Reply-To: <4682DCDF.5000301@crans.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 4682E2E6.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; threads:01 gtk:01 ocaml:01 crans:98 idiom:01 wrote:01 unix:01 unix:01 caml-list:01 descriptor:02 float:03 handler:03 library:03 i'd:05 standard:07 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