Skip to content

Commit 1dc59cb

Browse files
authored
Merge pull request #60 from chiangkd/master
Fix incorrect clock calculation on macOS
2 parents 67f5c71 + 99ad0cf commit 1dc59cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

utils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ static uint64_t semu_timer_clocksource(uint64_t freq)
4848
static mach_timebase_info_data_t t;
4949
if (t.denom == 0)
5050
(void) mach_timebase_info(&t);
51-
return mult_frac(mach_absolute_time() * freq, t.numer, t.denom);
51+
return mult_frac(mult_frac(mach_absolute_time(), freq, 1e9), t.numer,
52+
t.denom);
5253
#else
5354
return time(0) * freq;
5455
#endif

0 commit comments

Comments
 (0)