File tree 1 file changed +16
-3
lines changed
utils/swift-xcodegen/Sources/swift-xcodegen
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 11
11
//===----------------------------------------------------------------------===//
12
12
13
13
import ArgumentParser
14
- import Darwin
14
+ import Foundation
15
15
import SwiftXcodeGen
16
16
17
17
@main
@@ -399,14 +399,27 @@ struct SwiftXcodegen: AsyncParsableCommand, Sendable {
399
399
try lldbLLVMWorkspace. write ( " LLDB+LLVM " , into: outputDir)
400
400
}
401
401
}
402
- showCaveatsIfNeeded( )
402
+ }
403
+
404
+ func printingTimeTaken< T> ( _ fn: ( ) async throws -> T) async rethrows -> T {
405
+ let start = Date ( )
406
+ let result = try await fn ( )
407
+
408
+ // Note we don't print the time taken when we fail.
409
+ let delta = Date ( ) . timeIntervalSince ( start)
410
+ log. info ( " Successfully generated in \( Int ( ( delta * 1000 ) . rounded ( ) ) ) ms " )
411
+
412
+ return result
403
413
}
404
414
405
415
func run( ) async {
406
416
// Set the log level
407
417
log. logLevel = . init( self . logLevel ?? ( self . quiet ? . warning : . info) )
408
418
do {
409
- try await generate ( )
419
+ try await printingTimeTaken {
420
+ try await generate ( )
421
+ }
422
+ showCaveatsIfNeeded ( )
410
423
} catch {
411
424
log. error ( " \( error) " )
412
425
}
You can’t perform that action at this time.
0 commit comments