Skip to content

Instantly share code, notes, and snippets.

@MikeRatcliffe
Created July 17, 2017 10:13
Show Gist options
  • Save MikeRatcliffe/176bf3061e891fe3fa53835b9831dac7 to your computer and use it in GitHub Desktop.
Save MikeRatcliffe/176bf3061e891fe3fa53835b9831dac7 to your computer and use it in GitHub Desktop.
Performance API notes
performance.mark("startFoo");
// A time consuming function
foo();
performance.mark("endFoo");
performance.measure("durationFoo", "startFoo", "endFoo");
// Delete all Marks
performance.clearMarks();
// Delete the Measure "durationFoo"
performance.clearMeasure("durationFoo");
window.performance.clearMeasures('measure_load_from_dom');
var items = window.performance.getEntriesByType('mark');
var items = window.performance.getEntriesByType('measure');
var items = window.performance.getEntriesByName('mark_fully_loaded');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment