Open giampaolo opened 1 month ago
This code on Linux (but also on other systems) reads /proc/{pid}/stat twice:
/proc/{pid}/stat
ls = psutil.process_iter(["cpu_times"]) print(next(ls).info)
Internally we can make process_iter() rely on oneshot and only read /proc/{pid}/stat once.
process_iter()
oneshot
Summary
Description
This code on Linux (but also on other systems) reads
/proc/{pid}/stat
twice:Internally we can make
process_iter()
rely ononeshot
and only read/proc/{pid}/stat
once.