Skip to content

Commit

Permalink
chore: [#1451] Continue on implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
capricorn86 committed May 29, 2024
1 parent 7442c8d commit e6e52eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/happy-dom/src/window/BrowserWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,8 @@ export default class BrowserWindow extends EventTarget implements INodeJSGlobal
*/
public setTimeout(callback: Function, delay = 0, ...args: unknown[]): NodeJS.Timeout {
// We can group timeouts with a delay of 0 into one timeout to improve performance.
// Grouping timeouts will also improve the performance of the async task manager.
// It may also make the async task manager to stable as many timeouts may cause waitUntilComplete() to be resolved to early.
if (!delay) {
if (!this.#zeroTimeouts) {
const settings = this.#browserFrame.page?.context?.browser?.settings;
Expand Down

0 comments on commit e6e52eb

Please sign in to comment.