Skip to content

Instantly share code, notes, and snippets.

@charisTheo
Created December 4, 2020 14:17
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 charisTheo/e2b9606acb30fd3af5e978bdad4856b4 to your computer and use it in GitHub Desktop.
Save charisTheo/e2b9606acb30fd3af5e978bdad4856b4 to your computer and use it in GitHub Desktop.
Measure navigation timings using the Performance Observer
const entries = ["largest-contentful-paint", "navigation", "paint"];
entries.map(entry => {
const po = new PerformanceObserver((list) => {
for (const entry of list.getEntries()) {
console.log(entry.toJSON());
}
});
po.observe({type: entry});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment