diff --git a/files/en-us/web/api/idledeadline/timeremaining/index.md b/files/en-us/web/api/idledeadline/timeremaining/index.md index 5d11f0e0fec0cd0..748ac4949ed9775 100644 --- a/files/en-us/web/api/idledeadline/timeremaining/index.md +++ b/files/en-us/web/api/idledeadline/timeremaining/index.md @@ -9,17 +9,20 @@ browser-compat: api.IdleDeadline.timeRemaining {{APIRef("Background Tasks")}} The **`timeRemaining()`** method -on the {{domxref("IdleDeadline")}} interface returns the estimated number of -milliseconds remaining in the current idle period. The callback can call this method at +of the {{domxref("IdleDeadline")}} interface returns the estimated number of +milliseconds the user agent will remain idle for. The callback can call this method at any time to determine how much time it can continue to work before it must return. For example, if the callback finishes a task and has another one to begin, it can call `timeRemaining()` to see if there's enough time to complete the next task. If there isn't, the callback can just return immediately, or look for other work to do with the remaining time. -By the time `timeRemaining()` reaches 0, it is suggested that the callback +By the time `timeRemaining()` reaches `0`, it is suggested that the callback should return control to the user agent's event loop. +> [!NOTE] +> The value returned by `timeRemaining()` is an estimate of how much time the user agent believes is available before the next latency-critical task needs to run. This estimate is not fixed and can suddenly drop to 0 if higher-priority work arrives. For example, the browser's estimate can change in the middle of an idle callback if the user clicks. Developers should not assume the value always decreases linearly like a countdown timer. + ## Syntax ```js-nolint diff --git a/package-lock.json b/package-lock.json index 0c6c9d2a92ded3e..e3b570b24698af5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "markdownlint-rule-search-replace": "1.2.0", "node-html-parser": "^7.1.0", "parse-diff": "^0.12.0", - "prettier": "3.8.3", + "prettier": "3.8.4", "tempy": "^3.2.0", "yaml": "^2.9.0", "yargs": "^18.0.0" @@ -8154,9 +8154,9 @@ } }, "node_modules/prettier": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz", - "integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==", + "version": "3.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz", + "integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 799b6cadd929a2d..8d2373637eae21d 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "markdownlint-rule-search-replace": "1.2.0", "node-html-parser": "^7.1.0", "parse-diff": "^0.12.0", - "prettier": "3.8.3", + "prettier": "3.8.4", "tempy": "^3.2.0", "yaml": "^2.9.0", "yargs": "^18.0.0"