Last active
February 3, 2022 18:58
-
-
Save SebastianBoldt/d762a871d74b688e8b9693fc85e3a844 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
let task = Task { | |
for i in 0..<1_000_000_000_000_000 { | |
guard !Task.isCancelled else { | |
break | |
} | |
print(i) | |
} | |
} | |
task.cancel() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment