Module cpu

Source

Structs§

CPU
CPUStat
CPUTime

Functions§

get_all_cpu_utilization_in_percentage
Calculate all CPU utilization in percentage with or without the average within a specific time interval. It will cause the current thread to sleep. If the number it returns is 1.0, means 100%.
get_all_cpus_stat
Get all CPUs’ stats with or without the average by reading the /proc/stat file.
get_average_cpu_stat
Get average CPU stats by reading the /proc/stat file.
get_average_cpu_utilization_in_percentage
Calculate average CPU utilization in percentage within a specific time interval. It will cause the current thread to sleep. If the number it returns is 1.0, means 100%.
get_cpus
Get CPU information by reading the /proc/cpuinfo file.