diff options
| author | Harold Brenes <harold@hbrenes.com> | 2024-03-29 05:04:40 -0400 |
|---|---|---|
| committer | Harold Brenes <harold@hbrenes.com> | 2024-03-29 05:04:40 -0400 |
| commit | 13b8a5b73d12ed7c6c9a8ca6714a0aa36b82ecf8 (patch) | |
| tree | 825ce2395a8369da50c941988fd643ee2cb9b568 /src | |
| parent | b84a6608065cacb454a5dc531243abeb119c8823 (diff) | |
Reverting to calculated frequency timings method on macOS, but fixed
Diffstat (limited to 'src')
| -rw-r--r-- | src/timings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timings.cpp b/src/timings.cpp index e4165e3c0..712e804cb 100644 --- a/src/timings.cpp +++ b/src/timings.cpp @@ -44,12 +44,12 @@ gb_internal mach_timebase_info_data_t osx_init_timebase_info(void) { } gb_internal u64 osx_time_stamp_time_now(void) { - gb_local_persist mach_timebase_info_data_t data = osx_init_timebase_info(); - return (mach_absolute_time() * cast(u64)data.numer) / cast(u64)data.denom; // Effectively converts to nanoseconds + return mach_absolute_time(); } gb_internal u64 osx_time_stamp__freq(void) { - return 1000000000ull; // Nanoseconds to seconds + gb_local_persist mach_timebase_info_data_t data = osx_init_timebase_info(); + return 1000000000ull * cast(u64)data.denom / cast(u64)data.numer; } #elif defined(GB_SYSTEM_UNIX) |