Avatar
import Foundation final class BankAccount { var balance = 0 func deposit(_ amount: Int) -> Int { Thread.sleep(forTimeInterval: 1.0) balance += amount return balance } } func bankAccountMain() { let bankAccount = BankAccount() Task { print(bankAccount.deposit(100)) } Task { print(bankAccount.deposit(200)) } }