Created
April 14, 2023 14:12
-
-
Save mmocny/40714c2ee3851fd765765fd8a3674c28 to your computer and use it in GitHub Desktop.
Add these snippets to DevTools (console) Watch expressions
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
// max-INP: | |
(()=>{let o=globalThis;return void 0===o.winp&&(o.winp=0,new PerformanceObserver(n=>{for(let e of n.getEntries()){if(!e.interactionId)continue;o.winp=Math.max(e.duration,o.winp);let r=o=>o<=200?"color: green":o<=500?"color: yellow":"color: red";console.log(`%c[Interaction: ${e.name.padEnd(12)}] %cDuration: %c${e.duration}`,"color: grey; font-family: Consolas,monospace","",r(e.duration))}}).observe({type:"event",durationThreshold:0,buffered:!0})),o.winp})(); | |
// interactionCount | |
performance.interactionCount; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment