aboutsummaryrefslogtreecommitdiff
path: root/core/time
diff options
context:
space:
mode:
authorColin Davidson <colrdavidson@gmail.com>2025-06-08 16:16:34 -0700
committerColin Davidson <colrdavidson@gmail.com>2025-06-08 16:16:34 -0700
commitb1ed22d84f2aae617c90c60701e9f25345cab980 (patch)
tree6715a111e93880576ea6cc477a0c969f6bbe4767 /core/time
parentf1fdd1a8b9a53d34b59f8bac86ebba5f35189f28 (diff)
fix frequency grab
Diffstat (limited to 'core/time')
-rw-r--r--core/time/tsc_darwin.odin8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/time/tsc_darwin.odin b/core/time/tsc_darwin.odin
index 3726cff49..1210992a6 100644
--- a/core/time/tsc_darwin.odin
+++ b/core/time/tsc_darwin.odin
@@ -4,7 +4,13 @@ package time
import "core:sys/unix"
_get_tsc_frequency :: proc "contextless" () -> (freq: u64, ok: bool) {
- unix.sysctlbyname("machdep.tsc.frequency", &freq) or_return
+ if ODIN_ARCH == .amd64 {
+ unix.sysctlbyname("machdep.tsc.frequency", &freq) or_return
+ } else if ODIN_ARCH == .arm64 {
+ unix.sysctlbyname("hw.tbfrequency", &freq) or_return
+ } else {
+ return
+ }
ok = true
return
}