There are two functions doLotsOfWork1 and doLotsOfWork2, which do something and last for 5 milliseconds both. You need to wait for the result of their computations.
Coroutine builders: overview
Let's do some work
Report a typo
Write a program in Kotlin
fun doAllTheJob() {
println("Working...")
val firstJob = GlobalScope.launch {
doLotsOfWork1() // 5 ms
}
val secondjob = GlobalScope.launch {
doLotsOfWork2() // 5 ms
}
println("Finishing")
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.