Skip to content

Instantly share code, notes, and snippets.

@floatdrop
Created March 11, 2014 11:03
Show Gist options
  • Save floatdrop/9483673 to your computer and use it in GitHub Desktop.
Save floatdrop/9483673 to your computer and use it in GitHub Desktop.
var bluebird = require('bluebird');
suite('Bluebird', function () {
set('iterations', 1000); // the number of times to run a given bench
set('type', 'adaptive'); // or 'static' (see below)
set('mintime', 5000); // when adaptive, the minimum time in ms a bench should run
set('delay', 1000); // time in ms between each bench
bench('then next tick', function (done) {
var defer = bluebird.defer();
defer.promise.then(function () {
done();
});
process.nextTick(function () {
defer.resolve('ok');
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment