Skip to content

Commit

Permalink
timers: add sleep alias
Browse files Browse the repository at this point in the history
  • Loading branch information
ShogunPanda committed Aug 16, 2024
1 parent 8d37584 commit 0ff097d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/api/timers.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ const interval = 100;
})();
```

### `timersPromises.sleep([delay[, value[, options]]])`

An alias for [`timersPromises.setTimeout()`][].

### `timersPromises.scheduler.wait(delay[, options])`

<!-- YAML
Expand Down
1 change: 1 addition & 0 deletions lib/timers/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,5 @@ module.exports = {
scheduler: ReflectConstruct(function() {
this[kScheduler] = true;
}, [], Scheduler),
sleep: setTimeout,
};

0 comments on commit 0ff097d

Please sign in to comment.