Hi,
I want a LCP entry that has loadTime < FCP, but can't make it.
what I did is
// Load the image
await new Promise(function (resolve, reject) {
let image = new Image();
image.addEventListener('load', () => { resolve(image); console.log('Resolve Time', performance.now()); });
image.addEventListener('error', reject);
image.src = url;
image.setAttribute('decoding', 'sync');
});
// Add a text so that FCP is set.
const paragraph = document.createElement('p');
paragraph.innerHTML = text;
document.body.appendChild(paragraph);
//Attach Image
document.body.appendChild(img);
// Get the LCP entry corresponding to the image
lcp = await getLCPStartTime();
fcp = getFCPStartTime();
But the LCP.loadTime is not the one printed out when the promise resolves
and is larger than FCP.
Is this expected behavior?
or
Is there a way to force the LCP.loadTime < FCP and RenderTime>FCP?
Thanks!