summaryrefslogtreecommitdiffstats
path: root/darwin/Platform.h
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2021-08-25 19:15:17 +0200
committerDaniel Lange <DLange@git.local>2021-08-25 19:15:17 +0200
commitdf17374a92f7af03ae2c255a92f132056bf6a0fc (patch)
tree740efac73ae33c02ca512f46c3ee2f8119c73ef8 /darwin/Platform.h
parentfa48c484cc6db90736789b9ff811fd5bc8dc119d (diff)
parent59d0c5b26a55a68be059f2ac32a7c083b2ff01ee (diff)
Merge branch 'refactor-Darwin-platform-unit-conversion-helpers' of amomchilov/htop
Diffstat (limited to 'darwin/Platform.h')
-rw-r--r--darwin/Platform.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/darwin/Platform.h b/darwin/Platform.h
index b1733a56..b907a8d5 100644
--- a/darwin/Platform.h
+++ b/darwin/Platform.h
@@ -27,10 +27,6 @@ in the source distribution for its full text.
extern const ProcessField Platform_defaultFields[];
-extern double Platform_timebaseToNS;
-
-extern long Platform_clockTicksPerSec;
-
extern const SignalItem Platform_signals[];
extern const unsigned int Platform_numberOfSignals;
@@ -39,6 +35,14 @@ extern const MeterClass* const Platform_meterTypes[];
void Platform_init(void);
+// Converts ticks in the Mach "timebase" to nanoseconds.
+// See `mach_timebase_info`, as used to define the `Platform_nanosecondsPerMachTick` constant.
+uint64_t Platform_machTicksToNanoseconds(uint64_t mach_ticks);
+
+// Converts "scheduler ticks" to nanoseconds.
+// See `sysconf(_SC_CLK_TCK)`, as used to define the `Platform_schedulerTicksPerNS` constant.
+double Platform_schedulerTicksToNanoseconds(const double scheduler_ticks);
+
void Platform_done(void);
void Platform_setBindings(Htop_Action* keys);

© 2014-2024 Faster IT GmbH | imprint | privacy policy