Files
server_debian_macro/node_modules/tedious/benchmarks/connection/open.js
2025-02-18 22:59:07 +00:00

27 lines
401 B
JavaScript

const { createBenchmark, createConnection } = require('../common');
const bench = createBenchmark(main, {
n: [10, 100]
});
function main({ n }) {
let i = 0;
bench.start();
(function cb() {
createConnection(function(connection) {
connection.close();
if (i++ === n) {
bench.end(n);
connection.close();
return;
}
cb();
});
})();
}