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
1 changed files with 105 additions and 22 deletions
|
|
@ -8,7 +8,10 @@ use iced::{
|
|||
use ron::de;
|
||||
use smol::{Timer, unblock};
|
||||
|
||||
use crate::{app, sysinfo_snapshot::SysinfoSnapshot};
|
||||
use crate::{
|
||||
app,
|
||||
sysinfo_snapshot::{self, SysinfoSnapshot},
|
||||
};
|
||||
|
||||
pub fn create() -> Task<app::Message> {
|
||||
if env::args()
|
||||
|
|
@ -43,9 +46,7 @@ pub fn create() -> Task<app::Message> {
|
|||
1,
|
||||
async |mut sender: futures::channel::mpsc::Sender<SysinfoSnapshot>| {
|
||||
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);
|
||||
Timer::after(sysinfo::MINIMUM_CPU_UPDATE_INTERVAL).await;
|
||||
|
|
|
|||
Loading…
Reference in a new issue