MCPcopy
hub / github.com/jestjs/jest / countToFinish

Function countToFinish

packages/jest-worker/__benchmarks__/test.js:37–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35 let count = 0;
36
37 async function countToFinish() {
38 if (++count === calls) {
39 workerFarm.end(api);
40 const endTime = performance.now();
41
42 // Let all workers go down.
43 await sleep(2000);
44
45 resolve({
46 globalTime: endTime - startTime - 2000,
47 processingTime: endTime - startProcess,
48 });
49 }
50 }
51
52 const api = workerFarm(
53 {

Callers

nothing calls this directly

Calls 4

sleepFunction · 0.70
endMethod · 0.65
nowMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected