feat: process list
this is unnacceptably unperformant; I think I've reached the point at which sysinfo doesn't do what I want, which is keep track of a table of processes efficiently enough.
This commit is contained in:
parent
afa6104c28
commit
b20158820b
4 changed files with 105 additions and 22 deletions
|
|
@ -2,13 +2,11 @@ use std::{io::Write, thread};
|
|||
|
||||
use ron::{Error, ser};
|
||||
|
||||
use crate::sysinfo_snapshot::SysinfoSnapshot;
|
||||
use crate::sysinfo_snapshot::{self, SysinfoSnapshot};
|
||||
|
||||
pub fn run() -> Result<(), Error> {
|
||||
let mut sys = sysinfo::System::new();
|
||||
let refreshes = sysinfo::RefreshKind::nothing()
|
||||
.with_memory(sysinfo::MemoryRefreshKind::everything())
|
||||
.with_cpu(sysinfo::CpuRefreshKind::nothing().with_cpu_usage());
|
||||
let refreshes = sysinfo_snapshot::refreshes();
|
||||
|
||||
sys.refresh_specifics(refreshes);
|
||||
thread::sleep(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue