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

Function afterRead

benchmark/fs/readfile-promises.js:63–79  ·  view source on GitHub ↗
(er, data)

Source from the content-addressed store, hash-verified

61 }
62
63 function afterRead(er, data) {
64 if (er) {
65 throw er;
66 }
67
68 if (data.length !== len)
69 throw new Error('wrong number of bytes returned');
70
71 reads++;
72 const benchEnded = Date.now() >= endAt;
73
74 if (benchEnded && (++waitConcurrent) === concurrent) {
75 stop();
76 } else if (!benchEnded) {
77 read();
78 }
79 }
80
81 for (let i = 0; i < concurrent; i++) read();
82}

Callers 1

readFunction · 0.70

Calls 3

nowMethod · 0.80
stopFunction · 0.70
readFunction · 0.70

Tested by

no test coverage detected