Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: timer
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: e@f...
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