On Thursday, Apr 8, 2004, at 18:26 Europe/London, Philip Clayton wrote:
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.
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.)
Funnily enough, this issue came up on the basis library mailing list recently and yesterday John Reppy posted a message saying
W.r.t., the GC time question, I'd like to propose adding a function
val checkCPUTimes : cpu_timer -> { gc : {sys : Time.time, usr : Time.time}, other : {sys : Time.time, usr : Time.time}
Of course, that's not in the current version so to answer your immediate question, I've checked the source code and Poly/ML currently counts only the user time for the garbage collection time. If you were really interested in filtering out the system time you could modify the driver source function record_gc_time in timing.c . Regards, David.