Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Created December 12, 2013 11:05
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlwestin/7926372 to your computer and use it in GitHub Desktop.
Save karlwestin/7926372 to your computer and use it in GitHub Desktop.
Nice javascript unit testing (jasmine) trick: which spec takes the most time?
describe("test suite that you wanna perf", function() {
beforeEach(function() {
this.start = performance.now();
});
afterEach(function() {
console.log(jasmine.getEnv().currentSpec.description, performance.now() - this.start);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment