Created
November 20, 2015 23:15
-
-
Save RobertDaleSmith/cd2896fa71c76021ef9e to your computer and use it in GitHub Desktop.
Used to compare time it takes execute two different javascript lines.
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
function test(option){ | |
var start = Date.now(); | |
var result; | |
if(option){ | |
result = $('body').find('p + p + p').parent(); | |
}else{ | |
result = $('body').find(':has(> p + p + p)'); | |
} | |
var end = Date.now(); | |
return (end - start); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment