PageSpeed洞察和灯塔能够测量第一个内容油漆(FCP)、第一个有意义的油漆(FMP)和其他度量标准,但我如何测量第一个油漆(FP)?
发布于 2020-05-17 18:57:52
发布于 2020-06-18 12:50:51
您可以通过以下两种性能API方法来度量First- can (FP)。
getEntriesByType -代码片段如下:
const {name,startTime} = performance.getEntriesByType('paint');
console.log(Metric Name: ${name}, StartTime: ${startTime});

getEntriesByName -代码片段如下:
const {name,startTime} = performance.getEntriesByName('first-paint');
console.log(Metric Name: ${name}, StartTime: ${startTime});

https://stackoverflow.com/questions/61816232
复制相似问题