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:
parent
87187ff626
commit
9f7493c81f
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user