// This file was automatically generated from coroutines-guide.md by Knit tool. Do not edit. | |
package guide.basic.example03 | |
import kotlinx.coroutines.experimental.* | |
fun main(args: Array<String>) = runBlocking<Unit> { | |
val job = launch(CommonPool) { // create new coroutine and keep a reference to its Job | |
delay(1000L) | |
println("World!") | |
} | |
println("Hello,") | |
job.join() // wait until child coroutine completes | |
} |