Skip to content

Instantly share code, notes, and snippets.

@nixbytes
Created November 21, 2019 01:54
Show Gist options
  • Select an option

  • Save nixbytes/743613df2e04c1a6aaa095390cd13cd8 to your computer and use it in GitHub Desktop.

Select an option

Save nixbytes/743613df2e04c1a6aaa095390cd13cd8 to your computer and use it in GitHub Desktop.
javascript performance testing
const startingTime = performance.now();
for (let i = 1; i <= 100; i++) {
for (let j = 1; j <= 100; j++) {
console.log('i and j are ', i, j);
}
}
const endingTime = performance.now();
console.log('This code took ' + (endingTime - startingTime) + ' milliseconds.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment