File tree Expand file tree Collapse file tree
packages/astro/src/core/build Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' astro ' : patch
3+ ---
4+
5+ Improve fidelity of time stats when running ` astro build `
Original file line number Diff line number Diff line change @@ -287,15 +287,17 @@ async function generatePage(
287287 builtPaths
288288 ) ;
289289
290+ let prevTimeEnd = timeStart ;
290291 for ( let i = 0 ; i < paths . length ; i ++ ) {
291292 const path = paths [ i ] ;
292293 await generatePath ( path , generationOptions , pipeline ) ;
293294 const timeEnd = performance . now ( ) ;
294- const timeChange = getTimeStat ( timeStart , timeEnd ) ;
295+ const timeChange = getTimeStat ( prevTimeEnd , timeEnd ) ;
295296 const timeIncrease = `(+${ timeChange } )` ;
296297 const filePath = getOutputFilename ( pipeline . getConfig ( ) , path , pageData . route . type ) ;
297298 const lineIcon = i === paths . length - 1 ? '└─' : '├─' ;
298299 logger . info ( null , ` ${ cyan ( lineIcon ) } ${ dim ( filePath ) } ${ dim ( timeIncrease ) } ` ) ;
300+ prevTimeEnd = timeEnd ;
299301 }
300302}
301303
You can’t perform that action at this time.
0 commit comments