Skip to content

Instantly share code, notes, and snippets.

@daimajia
Created Oct 19, 2014
Embed
What would you like to do?
// http://www.v2ex.com/t/139818#reply90
var start = Date.now();
var sum = 0;
for(var i = 0; i <= 1000000000; ++i){
sum += i;
}
var end = Date.now();
var span = end - start;
console.log(span / 1000 + " seconds");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment