nullnet-libresmon 0.1.1

System resources monitoring library for NullNet
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use nullnet_libresmon::poll_system_resources;

fn main() {
    let resource_rx = poll_system_resources(1000);
    loop {
        match resource_rx.recv_blocking() {
            Ok(resources) => {
                let _ = std::process::Command::new("clear").status();
                println!("{resources}");
            }
            Err(e) => {
                eprintln!("Error receiving system resources: {e}");
            }
        }
    }
}