nix::sys::resource

Function getrusage

source
pub fn getrusage(who: UsageWho) -> Result<Usage>
Expand description

Get usage information for a process, its children or the current thread

Real time information can be obtained for either the current process or (in some systems) thread, but information about children processes is only provided for those that have terminated and been waited for (see super::wait::wait).

Some information may be missing depending on the platform, and the way information is provided for children may also vary. Check the manuals for details.

§References

Note: getrusage provides a safe wrapper to libc’s libc::getrusage.