Created
March 31, 2024 11:45
-
-
Save tokizuoh/95258f2531445de14234d8d838cf0569 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
Task.init { | |
try await sleep() // 何秒かかる? | |
} | |
} | |
func sleep() async throws { | |
async let _ = Task.sleep(nanoseconds: 2_000_000_000) | |
async let _ = Task.sleep(nanoseconds: 5_000_000_000) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment