Skip to content

Instantly share code, notes, and snippets.

@buschtoens
Created October 4, 2012 17:08
Show Gist options
  • Save buschtoens/3835002 to your computer and use it in GitHub Desktop.
Save buschtoens/3835002 to your computer and use it in GitHub Desktop.
var sanitize = require("./index.js")
, typeOf = sanitize.typeOf
, nameOf = sanitize.nameOf
, argsOf = sanitize.argsOf;
function stopwatch() {
var start = new Date();
return function stop() {
var end = new Date();
return end.getTime() - start.getTime();
};
}
var array = [];
var stop1 = stopwatch();
for(i = 0; i < 100000; i++) {
typeof array;
}
console.log("typeof array", stop1());
var stop2 = stopwatch();
for(i = 0; i < 100000; i++) {
typeOf(array);
}
console.log("typeOf(array)", stop2());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment