File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -50,12 +50,20 @@ function formatStatsMessage(
5050}
5151
5252function formatCompressionTime ( ms : number ) : string {
53- if ( ms < 1000 ) {
54- return `${ ms } ms`
53+ const totalSeconds = Math . max ( 0 , Math . round ( ms / 1000 ) )
54+ if ( totalSeconds < 60 ) {
55+ return `${ totalSeconds } s`
5556 }
5657
57- const seconds = ms / 1000
58- return `${ seconds . toFixed ( seconds < 10 ? 2 : 1 ) } s`
58+ const hours = Math . floor ( totalSeconds / 3600 )
59+ const minutes = Math . floor ( ( totalSeconds % 3600 ) / 60 )
60+ const seconds = totalSeconds % 60
61+
62+ if ( hours > 0 ) {
63+ return `${ hours } h ${ minutes } m ${ seconds } s`
64+ }
65+
66+ return `${ minutes } m ${ seconds } s`
5967}
6068
6169export async function handleStatsCommand ( ctx : StatsCommandContext ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments