Created
March 18, 2015 01:18
-
-
Save mbroadst/833ece981fdd118a99e2 to your computer and use it in GitHub Desktop.
This file contains 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 Benchmark = require('benchmark'); | |
// this outputs nothing | |
new Benchmark.Suite() | |
.add("TestBuffer", { | |
'setup': function() { | |
this.buffer = new Buffer(); | |
}, | |
'fn': function() { | |
console.log(this.buffer); | |
} | |
}) | |
.run(); | |
// this outputs tons of integers | |
new Benchmark.Suite() | |
.add("TestInt", { | |
'setup': function() { | |
this.value = 10; | |
}, | |
'fn': function() { | |
console.log(this.value); | |
} | |
}) | |
.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment