File tree Expand file tree Collapse file tree 3 files changed +21
-11
lines changed
Expand file tree Collapse file tree 3 files changed +21
-11
lines changed Original file line number Diff line number Diff line change 1- < script > performance . mark ( 'headStart ' ) ; </ script >
1+ < script > performance . mark ( 'HEAD_Start ' ) ; </ script >
22< meta charset =UTF-8 >
33< meta name =viewport content ="width=device-width, minimum-scale=1.0 ">
44
5050 //# sourceURL=debugbear.inline.js
5151</ script >
5252
53- < script > performance . mark ( 'cssStart ' ) ; </ script >
53+ < script > performance . mark ( 'CSS_Start ' ) ; </ script >
5454< style >
5555
5656 {% include css/ csswizardry.min .css %}
6363
6464</ style >
6565< script >
66- performance . mark ( 'cssEnd ' ) ;
66+ performance . mark ( 'CSS_End ' ) ;
6767
68- performance . measure ( 'cssTime ' , {
69- start : 'cssStart ' ,
70- end : 'cssEnd ' ,
68+ performance . measure ( 'CSS_Time ' , {
69+ start : 'CSS_Start ' ,
70+ end : 'CSS_End ' ,
7171 detail : {
7272 devtools : {
7373 dataType : 'track-entry' ,
163163{% endif %}
164164
165165< script >
166- performance . mark ( 'headEnd ' ) ;
166+ performance . mark ( 'HEAD_End ' ) ;
167167
168- performance . measure ( 'headTime ' , {
169- start : 'headStart ' ,
170- end : 'headEnd ' ,
168+ performance . measure ( 'HEAD_Time ' , {
169+ start : 'HEAD_Start ' ,
170+ end : 'HEAD_End ' ,
171171 detail : {
172172 devtools : {
173173 dataType : 'track-entry' ,
Original file line number Diff line number Diff line change 102102 //# sourceURL=sw.inline.js
103103 </ script >
104104
105- < script src =/js/obs.speedcurve.js?v =0003 type=module> </ script >
105+ < script src =/js/obs.speedcurve.js?v =0004 type=module> </ script >
Original file line number Diff line number Diff line change 7272 }
7373 }
7474
75+ /**
76+ * Compute new ‘First Potential Paint’ (FPP) metric. This is the time,
77+ * relative to navigation start, at which the browser finished parsing the
78+ * `<head>` and could potentially start rendering the `<body>`.
79+ */
80+ const navEntry = performance . getEntriesByType ( 'navigation' ) [ 0 ] ;
81+ const headEndMark = performance . getEntriesByName ( 'HEAD_End' ) [ 0 ] ;
82+ const fpp = headEndMark . startTime - navEntry . startTime ;
83+ // Assign FPP to a new `measure`.
84+ performance . measure ( 'fpp' , { start : navEntry . startTime , end : headEndMark . startTime } ) ;
7585
7686} ) ( ) ;
You can’t perform that action at this time.
0 commit comments