提交 c6f9c22c 编写于 作者: Q qq_38870145

Sat Mar 9 20:18:00 CST 2024 inscode

上级 c1d844d8
......@@ -34,6 +34,25 @@ class ListenDomChange {
// 之后,可停止观察
observer.disconnect();
}
getPerformance() {
// Time to when activation occurred
let activationStart =
performance.getEntriesByType("navigation")[0].activationStart;
// Time to first paint
let firstPaint = performance.getEntriesByName("first-paint")[0].startTime;
// Time to first contentful paint
let firstContentfulPaint = performance.getEntriesByName(
"first-contentful-paint",
)[0].startTime;
console.log("time to first paint: " + (firstPaint - activationStart));
console.log(
"time to first-contentful-paint: " + (firstContentfulPaint - activationStart),
);
}
}
export {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册