David Matthews wrote:
Philip Clayton wrote:
- Are the times printed by PolyML.timing `user' times or elapsed
times? (I suspect the first but would like to check...)
Do any of these times include garbage collection?
Is there any way for an ML program to access these times, i.e. can
they be bound (perhaps as a record) to an ML name? (Either at the top-level only or even within a program for time so far.)
- If the utime component of Posix.ProcEnv.times () was used to
measure sections of code within a program would this time include interludes for garbage collection? (Is the garbage collector a different process and therefore not counted in this `user' time?)
Have a look at the Timer structure in the standard basis library.
PolyML.timing uses Timer.startCPUTimer to start a timer and Timer.checkCPUTimer to get the time, adding together the system and user time. These are CPU time except in Windows 95 and 98 which don't have CPU timing when it uses elapsed time. They include GC time.
... the Timer structure. That includes a separate checkGCTime if you want the GC time.
You say that system and user times from Timer.checkCPUTimer include garbage collection. I would like to remove the garbage collection component from the user time. Hence I'd like to know whether the GC time from Timer.checkGCTime includes both system and user time or just user time? (I realize the system time, if included, will be small in comparison to the user time, but it would be useful to know.)
I am currently determining the running time of ML programs by performing test cases and fitting a function (in terms of a varied input) to the resulting times. As such, I'm looking to exclude garbage collection and system time to get a time that reflects the algorithms used in the program.
Thanks for your help, Phil.