Clarify that timeRemaining() is an estimate and not a fixed countdown (#37250)#44373
Open
BHUVANSH855 wants to merge 4 commits into
Open
Clarify that timeRemaining() is an estimate and not a fixed countdown (#37250)#44373BHUVANSH855 wants to merge 4 commits into
BHUVANSH855 wants to merge 4 commits into
Conversation
Contributor
|
Preview URLs (1 page) (comment last updated: 2026-06-09 08:02:15) |
chrisdavidmills
requested changes
Jun 8, 2026
chrisdavidmills
left a comment
Contributor
There was a problem hiding this comment.
Hi @BHUVANSH855, and thank you for your contribution. I've provided a couple of suggestions. I would also suggest moving the note to after the paragraph that follows it, as it looks a little weird sat below the note.
Bear in mind that I'm not an expert on this stuff; it might be good for @jyasskin to give it a quick look as well.
chrisdavidmills
approved these changes
Jun 9, 2026
chrisdavidmills
left a comment
Contributor
There was a problem hiding this comment.
@BHUVANSH855, looks good to me now. I'm just going to hold off on merging it to see if we can get some technical commentary on it.
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.
Description
Adds a note to the
IdleDeadline.timeRemaining()documentation clarifying that the returned value is an estimate of available idle time and should not be treated as a fixed countdown.Motivation
The current documentation may imply that
timeRemaining()continuously counts down during an idle period. However, the browser's estimate can change and may suddenly drop to0when higher-priority (latency-critical) work arrives. This update helps readers better understand the behavior of the API and avoid incorrect assumptions when scheduling background tasks.Additional details
The note was added to the introduction section of the page and is based on the discussion in the linked issue regarding how browsers determine remaining idle time.
Related issues and pull requests
Fixes #37250