sinf 0.1.0

Library for obtaining in-depth system information at both the hardware and software levels
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::sys::utils::get_sysctl_u64;

#[allow(unused_variables)]
pub(crate) fn get_cpu_frequency(brand: &str) -> u64 {
    if let Some(frequency) = get_sysctl_u64(b"hw.cpufrequency\0") {
        return frequency / 1_000_000;
    }

    #[cfg(any(target_os = "ios", feature = "apple-sandbox"))]
    {
        0
    }
    #[cfg(not(any(target_os = "ios", feature = "apple-sandbox")))]
    unsafe {
        crate::sys::inner::cpu::get_cpu_frequency(brand)
    }
}