We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
withTimeout
` func testAsync() async -> String { var value = 0 for _ in 0...10_000_0000 { value += 1 } return "(value)" }
Task { do { let res = try await withTimeout(0.25) { await testAsync() } print(res) } catch { print(error) } } `
The text was updated successfully, but these errors were encountered:
What is the content of testAsync ?? Every async function needs to cooperate for this to work. Read https://alejandromp.com/blog/the-importance-of-cooperative-cancellation/
testAsync
Sorry, something went wrong.
No branches or pull requests
`
func testAsync() async -> String {
var value = 0
for _ in 0...10_000_0000 {
value += 1
}
return "(value)"
}
The text was updated successfully, but these errors were encountered: