mirror of
https://github.com/FliegendeWurst/sysinfo.git
synced 2024-11-24 06:44:59 +00:00
Fix memory display
This commit is contained in:
parent
e92a608151
commit
2322feb5b7
@ -11,5 +11,5 @@ fn main() {
|
|||||||
let mut meminfo = meminfo.split('\n');
|
let mut meminfo = meminfo.split('\n');
|
||||||
let total = meminfo.next().unwrap().split_whitespace().nth(1).unwrap().parse::<u64>().unwrap() / 1_000;
|
let total = meminfo.next().unwrap().split_whitespace().nth(1).unwrap().parse::<u64>().unwrap() / 1_000;
|
||||||
let available = meminfo.nth(1).unwrap().split_whitespace().nth(1).unwrap().parse::<u64>().unwrap() / 1_000;
|
let available = meminfo.nth(1).unwrap().split_whitespace().nth(1).unwrap().parse::<u64>().unwrap() / 1_000;
|
||||||
println!("{:.1}% {:.1}°C {}/{}MB", load / num_cpus * 100.0, temp, available, total);
|
println!("{:.1}% {:.1}°C {}/{}MB", load / num_cpus * 100.0, temp, total - available, total);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user