Commit c3a6710
committed
Optimize semu_timer_clocksource() precision on macOS
Improve the precision of semu_timer_clocksource() by deferring the
division by 1e9 until the final step. Since t.numer and t.denom are
typically much smaller compared to the clock frequency and 1e9,
performing the division earlier in the calculation could result in a
significant loss of precision. This change ensures that precision is
preserved by delaying the division until the end of the computation.1 parent 1dc59cb commit c3a6710
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
| 51 | + | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
0 commit comments