1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-02-14 10:00:21 +00:00

linux.cc: Fix cpu usage bug (#600)

This commit is contained in:
lasers 2018-08-11 17:18:51 -05:00 committed by Brenden Matthews
parent 87187ff626
commit 9f7493c81f

View File

@ -932,6 +932,12 @@ int update_running_processes(void) {
}
int update_cpu_usage(void) {
struct timespec tc = {0L, 100L * 1000000L};
update_stat();
if (-1 == (nanosleep(&tc, NULL))) {
NORM_ERR("update_cpu_usage(): nanosleep() failed");
return 0;
}
update_stat();
return 0;
}