Skip to content

Instantly share code, notes, and snippets.

@tokizuoh
Created March 31, 2024 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tokizuoh/6a708c6c31df418243e3808d80ab1e6f to your computer and use it in GitHub Desktop.
Save tokizuoh/6a708c6c31df418243e3808d80ab1e6f to your computer and use it in GitHub Desktop.
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
Task.init {
try await sleep() // 何秒かかる?
}
}
func sleep() async throws {
try await Task.sleep(nanoseconds: 2_000_000_000)
try await 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