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

Function main

benchmark/webstreams/readable-async-iterator.js:12–31  ·  view source on GitHub ↗
({ n })

Source from the content-addressed store, hash-verified

10
11
12async function main({ n }) {
13 const rs = new ReadableStream({
14 pull: function(controller) {
15 controller.enqueue(1);
16 },
17 });
18
19 let x = 0;
20
21 bench.start();
22 for await (const chunk of rs) {
23 x += chunk;
24 if (x > n) {
25 break;
26 }
27 }
28 // Use x to ensure V8 does not optimize away the loop as a noop.
29 console.assert(x);
30 bench.end(n);
31}

Callers

nothing calls this directly

Calls 4

assertMethod · 0.80
enqueueMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…