Skip to content

Instantly share code, notes, and snippets.

@yorkie
Created March 18, 2015 02:18
Show Gist options
  • Save yorkie/931cf50a12815e2b5e3d to your computer and use it in GitHub Desktop.
Save yorkie/931cf50a12815e2b5e3d to your computer and use it in GitHub Desktop.
var tls = require('tls');
var start = Date.now();
function connect() {
tls.connect({host:'imap.gmail.com', port:993} , function() {
console.log('connected', Date.now() - start);
});
}
var max = 50
for (var i=0; i<max; i++)
connect()
@kenhkan
Copy link

kenhkan commented Mar 18, 2015

var tls = require('tls');
var start = Date.now();

function connect(i) {
  tls.connect({host:'imap.gmail.com', port:993} , function() {
    max--;
    console.log('connected', max, i, Date.now() - start);
    if (max===0) {
      process.exit(0);
    }
  });
}

var max = 500;
for (var i=0; i<max; i++) {
  connect(i);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment