Created
December 10, 2012 14:58
-
-
Save tricknotes/4251028 to your computer and use it in GitHub Desktop.
Performance check about arguments with EventEmitter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var EventEmitter = require('events').EventEmitter | |
var i; | |
var count = 100000000; | |
var e = new EventEmitter(); | |
e.on('hi', function() {}); | |
now = Date.now(); | |
for (i = 0; i < count; i++) { | |
e.emit('hi'); | |
} | |
console.log('%d ms', Date.now() - now); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment