@@ -1419,16 +1419,7 @@ export default async function build(
1419
1419
1420
1420
buildTraceContext = rest . buildTraceContext
1421
1421
1422
- let durationString
1423
- if ( compilerDuration > 120 ) {
1424
- durationString = `${ Math . round ( compilerDuration / 6 ) / 10 } min`
1425
- } else if ( compilerDuration > 20 ) {
1426
- durationString = `${ Math . round ( compilerDuration ) } s`
1427
- } else if ( compilerDuration > 2 ) {
1428
- durationString = `${ Math . round ( compilerDuration * 10 ) / 10 } s`
1429
- } else {
1430
- durationString = `${ Math . round ( compilerDuration * 1000 ) } ms`
1431
- }
1422
+ const durationString = durationToString ( compilerDuration )
1432
1423
Log . event ( `Compiled successfully in ${ durationString } ` )
1433
1424
1434
1425
telemetry . record (
@@ -1515,7 +1506,8 @@ export default async function build(
1515
1506
traceMemoryUsage ( 'Finished client compilation' , nextBuildSpan )
1516
1507
} )
1517
1508
1518
- Log . event ( 'Compiled successfully' )
1509
+ const durationString = durationToString ( durationInSeconds )
1510
+ Log . event ( `Compiled successfully in ${ durationString } ` )
1519
1511
1520
1512
telemetry . record (
1521
1513
eventBuildCompleted ( pagesPaths , {
@@ -3633,3 +3625,17 @@ export default async function build(
3633
3625
}
3634
3626
}
3635
3627
}
3628
+
3629
+ function durationToString ( compilerDuration : number ) {
3630
+ let durationString
3631
+ if ( compilerDuration > 120 ) {
3632
+ durationString = `${ ( compilerDuration / 60 ) . toFixed ( 1 ) } min`
3633
+ } else if ( compilerDuration > 40 ) {
3634
+ durationString = `${ compilerDuration . toFixed ( 0 ) } s`
3635
+ } else if ( compilerDuration > 2 ) {
3636
+ durationString = `${ compilerDuration . toFixed ( 1 ) } s`
3637
+ } else {
3638
+ durationString = `${ ( compilerDuration * 1000 ) . toFixed ( 0 ) } ms`
3639
+ }
3640
+ return durationString
3641
+ }
0 commit comments