// This file was automatically generated from coroutines-guide.md by Knit tool. Do not edit. | |
package guide.basic.example04 | |
import kotlinx.coroutines.experimental.* | |
fun main(args: Array<String>) = runBlocking<Unit> { | |
val job = launch(CommonPool) { doWorld() } | |
println("Hello,") | |
job.join() | |
} | |
// this is your first suspending function | |
suspend fun doWorld() { | |
delay(1000L) | |
println("World!") | |
} |