[dependencies]
sysinfo = "0.32.0"
use sysinfo::{
Components, Disks, Networks, System,
};
fn main() {
// Please note that we use "new_all" to ensure that all lists of
// CPUs and processes are filled!
let mut sys = System::new_all();
// First we update all information of our `System` struct.
sys.refresh_all();
// Display processes ID, name na disk usage:
for (pid, process) in sys.processes() {
println!("[{pid}] {:?}", process.name());
}
}
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询