Kotlin: coroutines basics
Example:
import kotlinx.coroutines.*
Coroutines are a way to write asynchronous code in a sequential manner.
Solution:
GlobalScope.launch {
delay(1000L)
print("World!")
}
print("Hello, ")
Thread.sleep(2000L)
Example: Solution:Kotlin: coroutines basics
Coroutines are a way to write asynchronous code in a sequential manner.
import kotlinx.coroutines.*
GlobalScope.launch {
delay(1000L)
print("World!")
}
print("Hello, ")
Thread.sleep(2000L)