<lambda>null1// This file was automatically generated from cancellation-and-timeouts.md by Knit tool. Do not edit. 2 package kotlinx.coroutines.guide.exampleCancel01 3 4 import kotlinx.coroutines.* 5 6 fun main() = runBlocking { 7 val job = launch { 8 repeat(1000) { i -> 9 println("job: I'm sleeping $i ...") 10 delay(500L) 11 } 12 } 13 delay(1300L) // delay a bit 14 println("main: I'm tired of waiting!") 15 job.cancel() // cancels the job 16 job.join() // waits for job's completion 17 println("main: Now I can quit.") 18 } 19