Skip to content

Commit

Permalink
Merge pull request #61 from visitorckw/optimize-semu-timer-precision
Browse files Browse the repository at this point in the history
Optimize semu_timer_clocksource() precision on macOS
  • Loading branch information
jserv authored Sep 12, 2024
2 parents 1dc59cb + c3a6710 commit 92218e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ static uint64_t semu_timer_clocksource(uint64_t freq)
static mach_timebase_info_data_t t;
if (t.denom == 0)
(void) mach_timebase_info(&t);
return mult_frac(mult_frac(mach_absolute_time(), freq, 1e9), t.numer,
t.denom);
return mult_frac(mult_frac(mach_absolute_time(), t.numer, t.denom), freq,
1e9);
#else
return time(0) * freq;
#endif
Expand Down

0 comments on commit 92218e3

Please sign in to comment.