kotlin import kotlinx.coroutines.* fun main() { println("Main thread starts") val job = GlobalScope.launch { println("Coroutine is executed") } runBlocking { job.join() } println("Main thread ends") } groovy implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:<version>' groovy implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:<version>'


上一篇:
下一篇:
切换中文