Run ❯
Get your
own
website
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Go to Spaces
Ctrl+Alt+P
import Dispatch func fetch(_ id: Int) async -> Int { id * 10 } print("Start") let sem = DispatchSemaphore(value: 0) Task { async let a = fetch(1) async let b = fetch(2) let total = await (a + b) print("Total \(total)") sem.signal() } sem.wait() print("Done")