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

Function measureAsync

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

Source from the content-addressed store, hash-verified

84}
85
86function measureAsync(n, op, key, keys, ciphertexts) {
87 let remaining = n;
88 function done() {
89 if (--remaining === 0)
90 bench.end(n);
91 else
92 one();
93 }
94
95 function one() {
96 const k = key || keys[n - remaining];
97 if (op === 'encapsulate') {
98 crypto.encapsulate(k, done);
99 } else {
100 crypto.decapsulate(k, ciphertexts[n - remaining], done);
101 }
102 }
103 bench.start();
104 one();
105}
106
107function measureAsyncParallel(n, op, key, keys, ciphertexts) {
108 let remaining = n;

Callers 1

mainFunction · 0.70

Calls 2

oneFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…