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.
Posix.ProcEnv.times uses the same underlying run-time system calls as the Timer functions, apart from the child process times. Unless you specifically need the child process times you're better off using the Timer structure. That includes a separate checkGCTime if you want the GC time.
Regards, David.