aboutsummaryrefslogtreecommitdiffstats
path: root/darwin/Platform.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2021-10-15 09:03:05 +0200
committerDaniel Lange <DLange@git.local>2021-10-15 09:03:05 +0200
commitc733b3f6130c70e100c21c4f77d8fd48db80622c (patch)
treefac3278283232938169f928fd3d3ab641d5c6c8e /darwin/Platform.c
parent4582ae87a0a0675d0756b93dcda052c533cd2c96 (diff)
parent30ce3b4c264c51c98f280e88e23792ff7deb2317 (diff)
downloaddebian_htop-c733b3f6130c70e100c21c4f77d8fd48db80622c.tar.gz
debian_htop-c733b3f6130c70e100c21c4f77d8fd48db80622c.tar.bz2
debian_htop-c733b3f6130c70e100c21c4f77d8fd48db80622c.zip
Update upstream source from tag 'upstream/3.1.1'
Update to upstream version '3.1.1' with Debian dir c4b5e8f6455cfd05bffdaed787e2ebf5c7d9a632
Diffstat (limited to 'darwin/Platform.c')
-rw-r--r--darwin/Platform.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/darwin/Platform.c b/darwin/Platform.c
index 93262bb..3f596a3 100644
--- a/darwin/Platform.c
+++ b/darwin/Platform.c
@@ -2,7 +2,7 @@
htop - darwin/Platform.c
(C) 2014 Hisham H. Muhammad
(C) 2015 David C. Hunt
-Released under the GNU GPLv2, see the COPYING file
+Released under the GNU GPLv2+, see the COPYING file
in the source distribution for its full text.
*/
@@ -35,6 +35,7 @@ in the source distribution for its full text.
#include "TasksMeter.h"
#include "UptimeMeter.h"
#include "darwin/DarwinProcessList.h"
+#include "darwin/PlatformHelpers.h"
#include "zfs/ZfsArcMeter.h"
#include "zfs/ZfsCompressedArcMeter.h"
@@ -42,6 +43,7 @@ in the source distribution for its full text.
#include <mach/clock.h>
#include <mach/mach.h>
#endif
+
#ifdef HAVE_MACH_MACH_TIME_H
#include <mach/mach_time.h>
#endif
@@ -125,15 +127,7 @@ static double Platform_nanosecondsPerMachTick = 1.0;
static double Platform_nanosecondsPerSchedulerTick = -1;
void Platform_init(void) {
- // Check if we can determine the timebase used on this system.
- // If the API is unavailable assume we get our timebase in nanoseconds.
-#ifdef HAVE_MACH_TIMEBASE_INFO
- mach_timebase_info_data_t info;
- mach_timebase_info(&info);
- Platform_nanosecondsPerMachTick = (double)info.numer / (double)info.denom;
-#else
- Platform_nanosecondsPerMachTick = 1.0;
-#endif
+ Platform_nanosecondsPerMachTick = Platform_calculateNanosecondsPerMachTick();
// Determine the number of scheduler clock ticks per second
errno = 0;

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