File tree 1 file changed +24
-6
lines changed
1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -275,12 +275,30 @@ impl<'a> JobQueue<'a> {
275
275
if profile. debuginfo . is_some ( ) {
276
276
opt_type += " + debuginfo" ;
277
277
}
278
- let duration = cx. bcx . config . creation_time ( ) . elapsed ( ) ;
279
- let time_elapsed = format ! (
280
- "{}.{:02} secs" ,
281
- duration. as_secs( ) ,
282
- duration. subsec_nanos( ) / 10_000_000
283
- ) ;
278
+
279
+ let time_elapsed = {
280
+ use std:: fmt:: Write ;
281
+
282
+ let duration = cx. bcx . config . creation_time ( ) . elapsed ( ) ;
283
+ let mut s = String :: new ( ) ;
284
+ let secs = duration. as_secs ( ) ;
285
+
286
+ if secs >= 60 {
287
+ // We can safely unwrap, as writing to a `String` never errors
288
+ write ! ( s, "{}m " , secs / 60 ) . unwrap ( ) ;
289
+ } ;
290
+
291
+ // We can safely unwrap, as writing to a `String` never errors
292
+ write ! (
293
+ s,
294
+ "{}.{:02}s" ,
295
+ secs % 60 ,
296
+ duration. subsec_nanos( ) / 10_000_000
297
+ ) . unwrap ( ) ;
298
+
299
+ s
300
+ } ;
301
+
284
302
if self . queue . is_empty ( ) {
285
303
let message = format ! (
286
304
"{} [{}] target(s) in {}" ,
You can’t perform that action at this time.
0 commit comments