devalexc
11/16/2018 - 8:22 PM

Corrutinas kotlin

fun main() = runBlocking { // this: CoroutineScope
        launch {
            delay(200L)
            println("segundo")
        }

        coroutineScope { // Nueva corrutine
            launch {
                delay(500L)
                println("tercera")
            }

            delay(100L)
            println("Primero")
        }

        println("Quintar") // Ultimo print
    }