Commit iniziale
This commit is contained in:
26
node_modules/tedious/benchmarks/connection/open.js
generated
vendored
Normal file
26
node_modules/tedious/benchmarks/connection/open.js
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
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();
|
||||
});
|
||||
})();
|
||||
}
|
||||
Reference in New Issue
Block a user