File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages/next/client/dev/error-overlay Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,11 @@ function onFastRefresh(hasUpdates) {
179
179
DevOverlay . onRefresh ( )
180
180
}
181
181
182
- console . log ( '[Fast Refresh] done' )
182
+ const latency = Date . now ( ) - startLatency
183
+ console . log ( `[Fast Refresh] done in ${ latency } ms` )
184
+ if ( self . __NEXT_HMR_LATENCY_CB ) {
185
+ self . __NEXT_HMR_LATENCY_CB ( latency )
186
+ }
183
187
}
184
188
185
189
// There is a newer version of the code available.
@@ -188,11 +192,14 @@ function handleAvailableHash(hash) {
188
192
mostRecentCompilationHash = hash
189
193
}
190
194
195
+ let startLatency = undefined
196
+
191
197
// Handle messages from the server.
192
198
function processMessage ( e ) {
193
199
const obj = JSON . parse ( e . data )
194
200
switch ( obj . action ) {
195
201
case 'building' : {
202
+ startLatency = Date . now ( )
196
203
console . log ( '[Fast Refresh] rebuilding' )
197
204
break
198
205
}
You can’t perform that action at this time.
0 commit comments