Skip to content

Instantly share code, notes, and snippets.

@JMPerez
Created June 17, 2017 08:21
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 JMPerez/64caddd67e86f15e4963cad2887ebfa2 to your computer and use it in GitHub Desktop.
Save JMPerez/64caddd67e86f15e4963cad2887ebfa2 to your computer and use it in GitHub Desktop.
Performance Observer example
var observer = new PerformanceObserver(function(list) {
var perfEntries = list.getEntries();
for (var i = 0; i < perfEntries.length; i++) {
// Process entries
// report back for analytics and monitoring
// ...
}
});
// register observer for long task notifications
observer.observe({entryTypes: ["paint"]});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment