signature MLTON_RUSAGE =
sig
type t = {utime: Time.time, (* user time *)
stime: Time.time} (* system time *)
val measureGC: bool -> unit
val rusage: unit -> {children: t, gc: t, self: t}
end
-
type t
corresponds to a subset of the C
struct rusage
. -
measureGC b
controls whether garbage collection time is separately measured during program execution. This affects the behavior of both
rusage
andTimer.checkCPUTimes
, both of which will return gc times of zero withmeasureGC false
. Garbage collection time is always measured when eithergc-messages
orgc-summary
is given as a runtime system option. -
rusage ()
corresponds to the C
getrusage
function. It returns the resource usage of the exited children, the garbage collector, and the process itself. Theself
component includes the usage of thegc
component, regardless of whethermeasureGC
istrue
orfalse
. Ifrusage
is used in a program, either directly, or indirectly via theTimer
structure, thenmeasureGC true
is automatically called at the start of the program (it can still be disable by user code later).