Skip to content

Commit

Permalink
Merge pull request #8619 from rickard-green/rickard/erl-monotonic-tim…
Browse files Browse the repository at this point in the history
…e-fix/OTP-19147

Fix monotonicity of Erlang monotonic time
  • Loading branch information
rickard-green authored Jun 27, 2024
2 parents bc61d42 + fee8f70 commit a755dbf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion erts/emulator/beam/erl_time_sup.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ calc_corrected_erl_mtime(ErtsMonotonicTime os_mtime,
diff += (cip->correction.drift*diff)/ERTS_MONOTONIC_TIME_UNIT;
erl_mtime = cip->erl_mtime;
erl_mtime += diff;
erl_mtime += cip->correction.error*(diff/ERTS_TCORR_ERR_UNIT);
erl_mtime += (cip->correction.error*diff)/ERTS_TCORR_ERR_UNIT;

if (os_mdiff_p)
*os_mdiff_p = diff;
return erl_mtime;
Expand Down

0 comments on commit a755dbf

Please sign in to comment.