pub fn cpu_delta_us(
start: Option<ProcessResourceUsage>,
end: Option<ProcessResourceUsage>,
) -> Option<i64>Expand description
CPU time consumed strictly between two ProcessResourceUsage snapshots,
in microseconds.
cpu_us on a snapshot is cumulative process CPU time since process
start, not CPU consumed by any one phase, so per-phase attribution needs
the delta between an entry and exit snapshot. The result is floored at
zero so a spurious (should-never-happen) decrease in cumulative CPU
between two reads never surfaces as a negative delta.