File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
utils/swift-xcodegen/Sources/swift-xcodegen Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change 1111//===----------------------------------------------------------------------===//
1212
1313import ArgumentParser
14- import Darwin
14+ import Foundation
1515import SwiftXcodeGen
1616
1717@main
@@ -399,14 +399,27 @@ struct SwiftXcodegen: AsyncParsableCommand, Sendable {
399399 try lldbLLVMWorkspace. write ( " LLDB+LLVM " , into: outputDir)
400400 }
401401 }
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
403413 }
404414
405415 func run( ) async {
406416 // Set the log level
407417 log. logLevel = . init( self . logLevel ?? ( self . quiet ? . warning : . info) )
408418 do {
409- try await generate ( )
419+ try await printingTimeTaken {
420+ try await generate ( )
421+ }
422+ showCaveatsIfNeeded ( )
410423 } catch {
411424 log. error ( " \( error) " )
412425 }
You can’t perform that action at this time.
0 commit comments