// Copyright (c) TribuFu. All Rights Reserved. use crate::GetSystemInfo; use sysinfo::{CpuExt, SystemExt}; /// Returns the number of physical cores of the current CPU. pub fn GetPhysicalCores() -> usize { num_cpus::get_physical() } /// Returns the number of logical cores of the current CPU. pub fn GetLogicalCores() -> usize { num_cpus::get() } /// Returns the model of the current CPU. pub fn GetProcessorModel() -> String { GetSystemInfo().global_cpu_info().brand().trim().to_string() } /// Returns the vendor of the current CPU. pub fn GetProcessorVendor() -> String { GetSystemInfo() .global_cpu_info() .vendor_id() .trim() .to_string() }