Skip to content

Instantly share code, notes, and snippets.

@ivanbtrujillo
Last active August 19, 2018 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanbtrujillo/eeee4831324187fea7010e3524d575f4 to your computer and use it in GitHub Desktop.
Save ivanbtrujillo/eeee4831324187fea7010e3524d575f4 to your computer and use it in GitHub Desktop.
Performance test of a given function
var perf = function(testName, fn) {
var startTime = new Date().getTime();
fn();
var endTime = new Date().getTime();
console.log(testName + ": " + (endTime - startTime) + "ms");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment