bit.ly/element-timing-origin-trial
Calculate time to first cat(TTFC) HTML
<img src="best_cat.jpg" elementtiming>
JS
const observer = new PerformanceObserver(list => {
list.getEntries().forEach(function(entry){
const navStart = performance.timing.navigationstart;
// ttfc = navigation until image rendered
const ttfc = entry.startTime - navStart;
console.log(`Time To First Cat ${ttfc}`)
});
});
observer.observe({entryTypes: ['element']});