fix frequency grab
This commit is contained in:
1 parent
f1fdd1a8b9
commit
b1ed22d84f
2 files changed
+9
-3
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user