Enable nodejs style global timers with a compat flag.#5751
Merged
Conversation
jasnell
reviewed
Dec 23, 2025
jasnell
reviewed
Dec 23, 2025
27c241d to
e4d3351
Compare
d208f6f to
ff010e2
Compare
Using the compat flag "enable_nodejs_global_timers" (now experimental), users can replace the global timer functions with NodeJS style timers.
ff010e2 to
d51725b
Compare
CodSpeed Performance ReportMerging #5751 will degrade performance by 11.59%Comparing Summary
Benchmarks breakdown
Footnotes
|
Collaborator
|
@vicb .. what do you mean by handling clearImmediate/setImmediate? That is already available. |
jasnell
approved these changes
Dec 23, 2025
Contributor
Dan added the implementation following my comment. All good now. |
anonrig
reviewed
Dec 23, 2025
anonrig
approved these changes
Dec 23, 2025
jasnell
reviewed
Dec 23, 2025
Comment on lines
+30
to
+31
| globalThis.setImmediate = setImmediate; | ||
| globalThis.clearImmediate = clearImmediate; |
Collaborator
There was a problem hiding this comment.
Overriding the setImmediate/clearImmediate should be unnecessary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using the compat flag "enable_nodejs_global_timers" (now experimental), users can replace the global timer functions with NodeJS style timers.