6 signature MLTON_RUSAGE =
8 type t = {utime: Time.time, (* user time *)
9 stime: Time.time} (* system time *)
11 val measureGC: bool -> unit
12 val rusage: unit -> {children: t, gc: t, self: t}
18 corresponds to a subset of the C `struct rusage`.
22 controls whether garbage collection time is separately measured during
23 program execution. This affects the behavior of both `rusage` and
24 `Timer.checkCPUTimes`, both of which will return gc times of zero with
25 `measureGC false`. Garbage collection time is always measured when
26 either `gc-messages` or `gc-summary` is given as a
27 <:RunTimeOptions:runtime system option>.
31 corresponds to the C `getrusage` function. It returns the resource
32 usage of the exited children, the garbage collector, and the process
33 itself. The `self` component includes the usage of the `gc`
34 component, regardless of whether `measureGC` is `true` or `false`. If
35 `rusage` is used in a program, either directly, or indirectly via the
36 `Timer` structure, then `measureGC true` is automatically called at
37 the start of the program (it can still be disable by user code later).