Re: timer

Doug Currie, Flavors Technology, Inc. (e@flavors.com)
Fri, 7 Jun 1996 18:23:23 -0400

Message-Id: <v01540b16adde57bce69c@[204.5.215.14]>
Date: Fri, 7 Jun 1996 18:23:23 -0400
To: caml-list@pauillac.inria.fr
From: e@flavors.com (Doug Currie, Flavors Technology, Inc.)
Subject: Re: timer

>[English: there is no means to measure elapsed time in Caml Light under PC or
>Macintosh. Is there the necessary C code primitive already written somewhere ?]

I did this for my Mac port of Caml Light 0.7 (which is not the official
port) and for Mac Moscow ML (which is the official port and is based on my
Mac Caml Light 0.7).

In my Mac Caml Light 0.7 and in Mac Moscow ML I implemented three timers:
- elapsed time
- time spent in GC
- time spent in "the cooperative multitasking experience"
and primitives to create additional timers.

To do this, macros to start and stop the various timers must be inserted in
many places in the runtime code. The Caml Light team decided not to include
my stuff, probably because so many changes were required in the source.

If you would like to see how it's done, get the Mac Moscow ML from
<http://www.dina.kvl.dk/~sestoft/mosml.html>. Look at the file runtime.c
and then look for uses of the macros beg_gc_time(), end_gc_time(),
beg_mf_time(), and end_mf_time(). gettimeofday is also implemented there in
e_gettimeofday.c.

e