diff --git a/erts/doc/guides/time_correction.md b/erts/doc/guides/time_correction.md index 9b5a99cf4c70..72e3752c191e 100644 --- a/erts/doc/guides/time_correction.md +++ b/erts/doc/guides/time_correction.md @@ -178,6 +178,23 @@ offset, you get current Erlang system time. To retrieve the current time offset, call `erlang:time_offset/0`. +### Timers + +All timers are triggered relative Erlang monotonic time. All timers currently +have millisecond resolution both in the API and internally in the runtime +system. That is, resolution (as well as precision and accuracy) will not be +higher than millisecond. If [Erlang monotonic time](#erlang-monotonic-time) has +a lower resolution than millisecond, the timer resolution will be lower than +millisecond as well. + +Timers can only be triggered on whole milliseconds since [the runtime +system start](`m:erlang#system_info_start_time`). A timer is not allowed to +trigger before the timeout time given by the user. That is, assuming that the +system is *not* heavily loaded, a timer will typically be triggered in the range +[`T`, `T+1`) milliseconds when the user has given the timeout time `T`. If the +system is heavily loaded, it may take an even longer time until a timer is +triggered. + ## Introduction Time is vital to an Erlang program and, more importantly, _correct_ time is diff --git a/erts/preloaded/ebin/erlang.beam b/erts/preloaded/ebin/erlang.beam index 448c9940848e..db3161848848 100644 Binary files a/erts/preloaded/ebin/erlang.beam and b/erts/preloaded/ebin/erlang.beam differ diff --git a/erts/preloaded/src/erlang.erl b/erts/preloaded/src/erlang.erl index 59f2d00f8bd7..6357cbeea608 100644 --- a/erts/preloaded/src/erlang.erl +++ b/erts/preloaded/src/erlang.erl @@ -5787,6 +5787,11 @@ See also [`erlang:send_after/4`](`send_after/4`), [`erlang:cancel_timer/2`](`cancel_timer/2`), and [`erlang:read_timer/2`](`read_timer/2`). +For more information on timers in Erlang in general, see the +[*Timers*](`e:erts:time_correction.md#timers`) section of the +[*Time and Time Correction in Erlang*](`e:erts:time_correction.md`) +ERTS User's guide. + Failure: `badarg` if the arguments do not satisfy the requirements specified here. """. diff --git a/lib/stdlib/src/timer.erl b/lib/stdlib/src/timer.erl index 999bb23965ed..e8c1a78e9c48 100644 --- a/lib/stdlib/src/timer.erl +++ b/lib/stdlib/src/timer.erl @@ -38,6 +38,11 @@ module has been improved in OTP 25, making it more efficient and less susceptible to being overloaded. See [the Timer Module section in the Efficiency Guide](`e:system:commoncaveats.md#timer-module`). +For more information on timers in Erlang in general, see the +[*Timers*](`e:erts:time_correction.md#timers`) section of the +[*Time and Time Correction in Erlang*](`e:erts:time_correction.md`) +ERTS User's guide. + ## Examples _Example 1_ diff --git a/system/doc/efficiency_guide/system_limits.md b/system/doc/efficiency_guide/system_limits.md index 6959cbfe9ba7..052ceafa00af 100644 --- a/system/doc/efficiency_guide/system_limits.md +++ b/system/doc/efficiency_guide/system_limits.md @@ -107,3 +107,8 @@ sufficiently unique. If a unique integer is created each nano second, unique integers will be reused at earliest after more than 584 years. That is, for the foreseeable future they are sufficiently unique. + +- ** Timer resolution ** - On most systems, millisecond resolution. For more + information, see the [*Timers*](`e:erts:time_correction.md#timers`) section of + the [*Time and Time Correction in Erlang*](`e:erts:time_correction.md`) ERTS + User's guide. diff --git a/system/doc/reference_manual/expressions.md b/system/doc/reference_manual/expressions.md index 82457d04f536..bc1b51683afb 100644 --- a/system/doc/reference_manual/expressions.md +++ b/system/doc/reference_manual/expressions.md @@ -777,6 +777,11 @@ timer(Pid) -> end. ``` +For more information on timers in Erlang in general, see the +[*Timers*](`e:erts:time_correction.md#timers`) section of the +[*Time and Time Correction in Erlang*](`e:erts:time_correction.md`) +ERTS User's guide. + ## Term Comparisons ```