summaryrefslogtreecommitdiffstats
path: root/src/app/data_harvester/cpu/heim/windows_macos.rs
blob: 6c110aabe4b5ff0cc36ea96febbe3f0b83412ee7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//! Windows and macOS-specific functions regarding CPU usage.

use crate::components::tui_widget::time_chart::Point;

pub fn convert_cpu_times(cpu_time: &heim::cpu::CpuTime) -> Point {
    let working_time: f64 =
        (cpu_time.user() + cpu_time.system()).get::<heim::units::time::second>();
    (
        working_time,
        working_time + cpu_time.idle().get::<heim::units::time::second>(),
    )
}