diff options
author | Alexander Momchilov <alexandermomchilov@gmail.com> | 2021-08-22 10:47:11 -0400 |
---|---|---|
committer | Alexander Momchilov <alexandermomchilov@gmail.com> | 2021-08-25 11:55:05 -0400 |
commit | 59d0c5b26a55a68be059f2ac32a7c083b2ff01ee (patch) | |
tree | 740efac73ae33c02ca512f46c3ee2f8119c73ef8 /darwin/DarwinProcessList.c | |
parent | fa48c484cc6db90736789b9ff811fd5bc8dc119d (diff) |
Refactor Darwin platform unit conversion helpers
Diffstat (limited to 'darwin/DarwinProcessList.c')
-rw-r--r-- | darwin/DarwinProcessList.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c index 3cfdca6f..7dd86ff5 100644 --- a/darwin/DarwinProcessList.c +++ b/darwin/DarwinProcessList.c @@ -160,13 +160,6 @@ void ProcessList_delete(ProcessList* this) { free(this); } -// Converts "scheduler ticks" to nanoseconds. -// See `sysconf(_SC_CLK_TCK)`, as used to define the `Platform_clockTicksPerSec` constant. -static double schedulerTicksToNanoseconds(const double ticks) { - const double nanos_per_sec = 1e9; - return ticks * (nanos_per_sec / (double) Platform_clockTicksPerSec); -} - void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { DarwinProcessList* dpl = (DarwinProcessList*)super; bool preExisting = true; @@ -194,7 +187,7 @@ void ProcessList_goThroughEntries(ProcessList* super, bool pauseProcessUpdate) { } } - const double time_interval_ns = schedulerTicksToNanoseconds(dpl->global_diff) / (double) dpl->super.activeCPUs; + const double time_interval_ns = Platform_schedulerTicksToNanoseconds(dpl->global_diff) / (double) dpl->super.activeCPUs; /* Clear the thread counts */ super->kernelThreads = 0; |