Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: SooHyoung Oh <shoh@compiler.kaist.ac.kr>
To: Anastasia Gornostaeva <ermine@ermine.pp.ru>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] timer
Date: Tue, 04 Jan 2005 10:11:06 +0900	[thread overview]
Message-ID: <41D9ED2A.8080906@compiler.kaist.ac.kr> (raw)
In-Reply-To: <20050103015835.GA22656@ermine.home>

[-- Attachment #1: Type: text/plain, Size: 2169 bytes --]

I have one at http://pllab.kaist.ac.kr/~shoh/ocaml/libs/timer/ .


  Module Timer
  <http://pllab.kaist.ac.kr/%7Eshoh/ocaml/libs/timer/doc/type_Timer.html>


module Timer: |sig| .. <http://pllab.kaist.ac.kr/%7Eshoh/ocaml/libs/timer/doc/Timer.html> |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 <http://pllab.kaist.ac.kr/%7Eshoh/ocaml/libs/timer/doc/Timer.html#TYPEid>|

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 <http://pllab.kaist.ac.kr/%7Eshoh/ocaml/libs/timer/doc/Timer.html#TYPEid> -> 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
>
>  
>

[-- Attachment #2: Type: text/html, Size: 3672 bytes --]

  reply	other threads:[~2005-01-04  1:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-03  1:58 timer Anastasia Gornostaeva
2005-01-04  1:11 ` SooHyoung Oh [this message]
2005-01-31 19:33   ` [Caml-list] timer Anastasia Gornostaeva
2005-01-31 21:21     ` Alain Frisch
2005-02-01  7:50     ` Ville-Pertti Keinonen
2005-02-01 12:22       ` Anastasia Gornostaeva
2005-02-01 14:30         ` Ville-Pertti Keinonen

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=41D9ED2A.8080906@compiler.kaist.ac.kr \
    --to=shoh@compiler.kaist.ac.kr \
    --cc=caml-list@yquem.inria.fr \
    --cc=ermine@ermine.pp.ru \
    /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