Kotlin 2 · Coroutines
Limit how long work can take
Cancel a block that takes too long.
val result = withTimeoutOrNull(1_000) { slowCall() }
Official Kotlin 2 documentation
Kotlin 2 · Coroutines
Cancel a block that takes too long.
val result = withTimeoutOrNull(1_000) { slowCall() }
Official Kotlin 2 documentation
Was this page helpful?