Created
October 4, 2012 17:08
-
-
Save buschtoens/3835002 to your computer and use it in GitHub Desktop.
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 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