Skip to content

timer: fixes and improvements#11241

Open
Maria-12648430 wants to merge 2 commits into
erlang:masterfrom
Maria-12648430:improve_timer
Open

timer: fixes and improvements#11241
Maria-12648430 wants to merge 2 commits into
erlang:masterfrom
Maria-12648430:improve_timer

Conversation

@Maria-12648430

Copy link
Copy Markdown
Contributor

The first commit in this PR fixes two inconsistencies:

  • When timer:send_after(0, PidOrRegName, Msg) was used and PidOrRegName was an atom which was not registered at the time of the call, a badarg exception was raised instead of returning {error, badarg} like everywhere else
  • When timer:send_after(Time, Pid, Msg) was used, where Pid was a local pid and Time would exceed the erlang:start_timer interval (see here), a badarg exception was raised instead of returning {error, badarg} like everywhere else

It also optimizes two timer:send_after cases:

  • timer:send_after(Time, RegName, Msg) (where RegName is a locally registered name) has been changed to use erlang:send_after directly and not go through the timer server process
  • timer:send_after(Time, {RegName, Node}, Msg) (where RegName a registered name at node Node, and Node is the local node) has been changed to use erlang:send_after directly and not go through the timer server process

The second commit in this PR contains documentation fixes and rewordings in order to read more modern.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

CT Test Results

    2 files    100 suites   1h 7m 18s ⏱️
2 299 tests 2 247 ✅ 52 💤 0 ❌
2 718 runs  2 662 ✅ 56 💤 0 ❌

Results for commit 7e4a3c5.

♻️ This comment has been updated with latest results.

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

// Erlang/OTP Github Action Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant