Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Cancellation using withTimeout / withTimeoutOrNull
import kotlinx.coroutines.*
fun main() {
runBlocking {
withTimeout(1000L) {
repeat(50) { waitingTime ->
println("Job is waiting $waitingTime...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment