Skip to content

Instantly share code, notes, and snippets.

@bengl bengl/loopyfunctioney.js
Last active Aug 10, 2017

Embed
What would you like to do?
// Try running this file in Node 8.2.1
// Try running this file in Node 8.3.0
// Try running this file in d8 for Node 8.3.0
function empty() {}
let i, j, d;
for(j = 0; j < 5; j++) {
d = Date.now();
for (i = 0; i < 1e7; i++) {
empty();
}
console.log(j, 0, Date.now() - d);
d = Date.now();
for (i = 0; i < 1e7; i++) {
empty();
}
console.log(j, 1, Date.now() - d);
d = Date.now();
for (i = 0; i < 1e7; i++) {
empty();
}
console.log(j, 2, Date.now() - d);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.