Coroutines are computer program components that generalize subroutines for non-preemptive multitasking, by allowing execution to be suspended and resumed. Coroutines are well-suited for implementing familiar program components such as cooperative tasks, exceptions, event loops, iterators, infinite lists and pipes.
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.2.1'implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1'
suspend fun main() = coroutineScope {for(i in 0 until 10) {launch {delay(1000L - i * 10)print("❤️$i ")}}}
