psutil 5.4.0

Process and system monitoring library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// https://github.com/heim-rs/heim/blob/master/heim-common/src/sys/unix.rs

use nix::unistd;
use once_cell::sync::Lazy;

use crate::{Bytes, FloatCount};

pub(crate) static TICKS_PER_SECOND: Lazy<FloatCount> = Lazy::new(|| {
	unistd::sysconf(unistd::SysconfVar::CLK_TCK)
		.unwrap()
		.unwrap() as FloatCount
});

pub(crate) static PAGE_SIZE: Lazy<Bytes> = Lazy::new(|| {
	unistd::sysconf(unistd::SysconfVar::PAGE_SIZE)
		.unwrap()
		.unwrap() as Bytes
});