MCPcopy Index your code
hub / github.com/nodejs/node / loop

Function loop

test/parallel/test-vm-timeout-escape-promise-module.js:16–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14const hrtime = process.hrtime.bigint;
15
16function loop() {
17 const start = hrtime();
18 while (1) {
19 const current = hrtime();
20 const span = (current - start) / NS_PER_MS;
21 if (span >= 2000n) {
22 throw new Error(
23 `escaped timeout at ${span} milliseconds!`);
24 }
25 }
26}
27
28assert.rejects(async () => {
29 const module = new vm.SourceTextModule(

Callers

nothing calls this directly

Calls 1

hrtimeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…