📜  未解决的参考启动 kotlin - 任何代码示例

📅  最后修改于: 2022-03-11 14:59:42.640000             🧑  作者: Mango

代码示例1
fun main() { 
    GlobalScope.launch { // launch a new coroutine in background and continue
        delay(1000L)
        println("World!")
    }
    println("Hello,") // main thread continues here immediately
    runBlocking {     // but this expression blocks the main thread
        delay(2000L)  // ... while we delay for 2 seconds to keep JVM alive
    } 
}