@@ -91,7 +91,7 @@ <h3 id="title"></h3>
91
91
return time / 1000000000 ;
92
92
}
93
93
94
- function fmt_delta ( to , delta ) {
94
+ function fmt_delta ( to , delta , is_integral_delta ) {
95
95
let from = to - delta ;
96
96
let pct = ( to - from ) / from * 100 ;
97
97
if ( from == to ) {
@@ -110,7 +110,12 @@ <h3 id="title"></h3>
110
110
if ( Math . abs ( delta ) <= 0.05 ) {
111
111
classes = "neutral" ;
112
112
}
113
- let text = delta . toFixed ( 3 ) ;
113
+ let text ;
114
+ if ( is_integral_delta ) {
115
+ text = delta . toString ( ) ;
116
+ } else {
117
+ text = delta . toFixed ( 3 ) ;
118
+ }
114
119
if ( pct != Infinity && pct != - Infinity ) {
115
120
text += `(${ pct . toFixed ( 1 ) } %)` . padStart ( 10 , ' ' ) ;
116
121
} else {
@@ -260,13 +265,13 @@ <h3 id="title"></h3>
260
265
}
261
266
td ( row , to_seconds ( cur . self_time ) . toFixed ( 3 ) ) ;
262
267
if ( delta ) {
263
- td ( row , fmt_delta ( to_seconds ( cur . self_time ) , to_seconds ( delta . self_time ) ) , true ) ;
268
+ td ( row , fmt_delta ( to_seconds ( cur . self_time ) , to_seconds ( delta . self_time ) , false ) , true ) ;
264
269
} else {
265
270
td ( row , "-" , true ) ;
266
271
}
267
272
td ( row , cur . invocation_count ) ;
268
273
if ( delta ) {
269
- td ( row , fmt_delta ( cur . invocation_count , delta . invocation_count ) , true ) ;
274
+ td ( row , fmt_delta ( cur . invocation_count , delta . invocation_count , true ) , true ) ;
270
275
} else {
271
276
td ( row , "-" , true ) ;
272
277
}
@@ -277,6 +282,7 @@ <h3 id="title"></h3>
277
282
fmt_delta (
278
283
to_seconds ( cur . incremental_load_time ) ,
279
284
to_seconds ( delta . incremental_load_time ) ,
285
+ false ,
280
286
) ,
281
287
true ) . classList . add ( "incr" ) ;
282
288
} else {
0 commit comments