Can someone explain me why the compiler has execut...
# coroutines
e
Can someone explain me why the compiler has executed the line 24 before starting the coroutine at the line 18 ?
o
the time it takes to go from "scheduling the coroutine" to "next line of code in same method (line 24)" is much smaller than "start and execute a coroutine" however, specifically in this case, line 24 will always execute first, because
runBlocking
is single-threaded, so the code currently executing on the thread must finish/suspend before other code can be executed. as you can see, once
delay
was called, execution switched over to the
launch
👍 3
e
Okay thanks 🙏