MCPcopy Create free account
hub / github.com/nodejs/node / delay

Function delay

test/parallel/test-promise-unhandled-issue-43655.js:6–10  ·  view source on GitHub ↗
(time)

Source from the content-addressed store, hash-verified

4const assert = require('assert');
5
6function delay(time) {
7 return new Promise((resolve) => {
8 setTimeout(resolve, time);
9 });
10}
11
12async function test() {
13 for (let i = 0; i < 100000; i++) {

Callers 1

testFunction · 0.70

Calls 1

setTimeoutFunction · 0.50

Tested by 1

testFunction · 0.56