Last active
March 13, 2018 04:48
-
-
Save Zizzamia/6132d85489713af539ddc4b38a0f7b00 to your computer and use it in GitHub Desktop.
First (Contentful) Paint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const perfObserver = new PerformanceObserver((performanceEntryList) => { | |
for (const performanceEntry of performanceEntryList.getEntries()) { | |
console.log(performanceEntry.name); // 'first-paint' or 'first-contentful-paint' | |
console.log(performanceEntry.startTime); // DOMHighResTimeStamp | |
} | |
}); | |
perfObserver.observe({ entryTypes: ["paint"] }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment