diff options
author | Daniel Lange <DLange@git.local> | 2020-12-13 20:02:38 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2020-12-13 20:02:38 +0100 |
commit | 4b1a4a4ebd1e547ee8e101d4aaeadbaf79d932e1 (patch) | |
tree | 1aab95fd258d103b04bf955f0d04f9b91c571852 /darwin/DarwinProcess.c | |
parent | 3655b6ca0b1b89a2d6415211c1ce484dd6afe39f (diff) | |
parent | f32f0188cd140f965c5e02f7fb875116522c4b41 (diff) |
Merge branch 'fix_mach_timebase' of benbe/htop
Diffstat (limited to 'darwin/DarwinProcess.c')
-rw-r--r-- | darwin/DarwinProcess.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c index 0c20bc61..d8d7ab7b 100644 --- a/darwin/DarwinProcess.c +++ b/darwin/DarwinProcess.c @@ -14,6 +14,7 @@ in the source distribution for its full text. #include <mach/mach.h> #include "CRT.h" +#include "Platform.h" #include "Process.h" @@ -308,7 +309,7 @@ void DarwinProcess_setFromLibprocPidinfo(DarwinProcess* proc, DarwinProcessList* uint64_t diff = (pti.pti_total_system - proc->stime) + (pti.pti_total_user - proc->utime); - proc->super.percent_cpu = (double)diff * (double)dpl->super.cpuCount + proc->super.percent_cpu = (double)diff * (double)dpl->super.cpuCount * Platform_timebaseToNS / ((double)dpl->global_diff * 100000.0); // fprintf(stderr, "%f %llu %llu %llu %llu %llu\n", proc->super.percent_cpu, |