Let's do some work

Report a typo

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.

This task uses dependencies that may not be available in your local IDE. As a result, you may see compilation errors or unresolved references when running the code locally. This does not affect solution validation when you submit your solution to Hyperskill.

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")
}

Create a free account to access the full topic