www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Process Information

reply r-const-dev <r.const.dev gmail.com> writes:
Is there a way to get information about the current process?
Memory usage, CPU usage, PID.
Feb 23
parent Cym13 <cpicard openmailbox.org> writes:
On Saturday, 23 February 2019 at 20:49:49 UTC, r-const-dev wrote:
 Is there a way to get information about the current process?
 Memory usage, CPU usage, PID.
The PID is easy, from std.process it's a standard function call away: https://dlang.org/phobos/std_process.html#.thisProcessID I don't think there is anything in phobos about memory or cpu usage. If you're on GNU/Linux you can probe /proc/self/stat and /proc/self/status to get that information, I don't know about windows.
Feb 23