From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id AE3B2BB81 for ; Tue, 4 Jan 2005 02:11:04 +0100 (CET) Received: from miritek.com (v30-53.icu.ac.kr [210.107.130.53] (may be forged)) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j041B14V006272 for ; Tue, 4 Jan 2005 02:11:03 +0100 Received: from [192.168.1.21] (v30-54.icu.ac.kr [210.107.130.54] (may be forged)) by miritek.com (8.9.3/8.9.3) with ESMTP id KAA13569; Tue, 4 Jan 2005 10:23:26 +0900 Message-ID: <41D9ED2A.8080906@compiler.kaist.ac.kr> Date: Tue, 04 Jan 2005 10:11:06 +0900 From: SooHyoung Oh User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: ko-kr, ko, en-us, en MIME-Version: 1.0 To: Anastasia Gornostaeva Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] timer References: <20050103015835.GA22656@ermine.home> In-Reply-To: <20050103015835.GA22656@ermine.home> Content-Type: multipart/alternative; boundary="------------000208030206090005050805" X-Miltered: at concorde with ID 41D9ED25.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; compiler:01 caml-list:01 ocaml:01 libs:01 ocaml:01 libs:01 sig:01 val:01 val:01 threads:01 caml-list:01 beginner's:01 beginners:01 bug:01 sig:01 X-Attachments: cset="KOI8-R" cset="KOI8-R" X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO,HTML_50_60, HTML_MESSAGE autolearn=disabled version=3.0.0 X-Spam-Level: This is a multi-part message in MIME format. --------------000208030206090005050805 Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit I have one at http://pllab.kaist.ac.kr/~shoh/ocaml/libs/timer/ . Module Timer module Timer: |sig| .. |end| timer library. This library uses Sys module and unix, thread library. ------------------------------------------------------------------------ type ||id callback id. This is returned from registering timer callback and used for unregistering. val init : |?tck_unit:float -> unit -> unit| initializer timer library. This should be called before calling any timer function. |tck_unit| : tick unit of tick timer. (default value is 100 milli seconds) val reset : |unit -> unit| reset timer library. Timer functions can be called anymore. val register : |(unit -> unit) -> float -> float -> id | register callback. /register f start interval/ registers callback fucntion /f/ which will be called after /start/ milli seconds at first and every /interval/ milli seconds after the first calling. If /interval/ is zero, the callback function is called only once. *Returns* id the registered callback id. val unregister : |id -> unit| unregister callback. val msleep : |float -> unit| sleep for the given time in milli seconds. Anastasia Gornostaeva ? ?: >Hello. > >Does exist Timer module, that allows me add/reset/remove timed events? >Currently I use Unix.setitimer() for my simple implementation that allows >only adding new events into a queue, but my skills is not enough to implement >reset and remove events from the Timer queue. >And I'm not sure if using Unix.sleep() with setitimer() is safely (without >Threads). >Thanks. > >ermine > >_______________________________________________ >Caml-list mailing list. Subscription management: >http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list >Archives: http://caml.inria.fr >Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >Bug reports: http://caml.inria.fr/bin/caml-bugs > > > --------------000208030206090005050805 Content-Type: text/html; charset=KOI8-R Content-Transfer-Encoding: 7bit I have one at http://pllab.kaist.ac.kr/~shoh/ocaml/libs/timer/ .

Module Timer


module Timer: sig .. end
timer library. This library uses Sys module and unix, thread library.

type id 
callback id. This is returned from registering timer callback and used for unregistering.
val init : ?tck_unit:float -> unit -> unit
initializer timer library. This should be called before calling any timer function.

tck_unit : tick unit of tick timer. (default value is 100 milli seconds)
val reset : unit -> unit
reset timer library. Timer functions can be called anymore.
val register : (unit -> unit) -> float -> float -> id
register callback. register f start interval registers callback fucntion f which will be called after start milli seconds at first and every interval milli seconds after the first calling. If interval is zero, the callback function is called only once.
Returns id the registered callback id.
val unregister : id -> unit
unregister callback.
val msleep : float -> unit
sleep for the given time in milli seconds.

Anastasia Gornostaeva 쓴 글:
Hello.

Does exist Timer module, that allows me add/reset/remove timed events?
Currently I use Unix.setitimer() for my simple implementation that allows
only adding new events into a queue, but my skills is not enough to implement
reset and remove events from the Timer queue.
And I'm not sure if using Unix.sleep() with setitimer() is safely (without
Threads).
Thanks.

ermine

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

  
--------------000208030206090005050805--