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

Function measureAsyncParallel

benchmark/crypto/kem.js:107–122  ·  view source on GitHub ↗
(n, op, key, keys, ciphertexts)

Source from the content-addressed store, hash-verified

105}
106
107function measureAsyncParallel(n, op, key, keys, ciphertexts) {
108 let remaining = n;
109 function done() {
110 if (--remaining === 0)
111 bench.end(n);
112 }
113 bench.start();
114 for (let i = 0; i < n; ++i) {
115 const k = key || keys[i];
116 if (op === 'encapsulate') {
117 crypto.encapsulate(k, done);
118 } else {
119 crypto.decapsulate(k, ciphertexts[i], done);
120 }
121 }
122}
123
124function main({ n, mode, keyFormat, keyType, op }) {
125 const isEncapsulate = op === 'encapsulate';

Callers 1

mainFunction · 0.70

Calls 1

startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…