Resources

From wiki
Revision as of 16:11, 11 January 2022 by Hdridder (talk | contribs) (Created page with "Category:Python The resources modules provides information about the current process. <syntaxhighlight lang=python> import resource resource.getrusage(resource.RUSAGE_SE...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


The resources modules provides information about the current process.

import resource
resource.getrusage(resource.RUSAGE_SELF)

resource.struct_rusage(ru_utime=0.008208, ru_stime=0.013339, ru_maxrss=5164, ru_ixrss=0, ru_idrss=0, ru_isrss=0, ru_minflt=1420, ru_majflt=2, ru_nswap=0, ru_inblock=1520, ru_oublock=0, ru_msgsnd=0, ru_msgrcv=0, ru_nsignals=0, ru_nvcsw=92, ru_nivcsw=1)

You can address the individual items as e.g resource.getrusage(resource.RUSAGE_SELF).ru_maxrss