Dear Mark,

You are right, {Property.get 'time.total'} is your friend for measuring runtime. Here is a little tool I use for that :)

/** %% Returns the time (in msecs) the application of P (a null- ary procedure) took.
   %% */
   fun {TimeSpend P}
      Start End
   in
      Start = {Property.get 'time.total'}
      {P}
      End = {Property.get 'time.total'}
      End - Start
   end

{TimeSpend
proc {$} {ForAll {List.number 1 1000000 1} proc {$ X} _ = X*X end} end}

The returned time is reported in multiples of 10 msec, because Mozart uses hardware timer for thread preemption, and their time slice is 10 msec long. See CTM, Sec 4.2.4 for some details on this.

Best
Torsten

--
Torsten Anders
Interdisciplinary Centre for Computer Music Research
University of Plymouth
Office: +44-1752-586219
Private: +44-1752-558917
http://strasheela.sourceforge.net
http://www.torsten-anders.de





On Sep 22, 2008, at 9:47 PM, mark wrote:

Hi,

I have been looking into ways to time a program accurately.
I have used the {Property.get 'time.total'} function but this only seems
to return time in multiples of 10ms.
Is it possible to get the accuracy down to actual millisecond intervals? My linux box reports time in single milliseconds from the command prompt. I notice there is a 'time.detailed' property but I'm not sure if or how
this may work.

Any help would be gratefully accepted,

Regards
Mark

--
Mark Richardson
Final year undergraduate
University of Teesside

______________________________________________________________________ ___________ mozart-users mailing list mozart- [EMAIL PROTECTED]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to