diff options
| author | gingerBill <bill@gingerbill.org> | 2021-02-25 00:39:26 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-02-25 00:39:26 +0000 |
| commit | b2fdb53e26b431f98abec1e522b242a4be906ec2 (patch) | |
| tree | 214674529c8abadb0c9f3e996008ae7916aea80d | |
| parent | 58422711d1fdb6af8d4c97e375197647926df622 (diff) | |
fix timings.cpp for M1
| -rw-r--r-- | src/timings.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/timings.cpp b/src/timings.cpp index 873e9493d..594f6d27e 100644 --- a/src/timings.cpp +++ b/src/timings.cpp @@ -42,7 +42,13 @@ u64 osx_time_stamp__freq(void) { data.numer = 0; data.denom = 0; mach_timebase_info(&data); - return (data.numer / data.denom) * 1000000000; +#if defined(GB_CPU_ARM) + // NOTE(bill, 2021-02-25): M1 Chip seems to have a different freq count + // TODO(bill): Is this truly correct? + return (1000000llu * cast(u64)data.numer) / cast(u64)data.denom; +#else + return (1000000000llu * cast(u64)data.numer) / cast(u64)data.denom; +#endif } #elif defined(GB_SYSTEM_UNIX) |