I am running this code snippet: ```import kotlinx...
# getting-started
p
I am running this code snippet:
Copy code
import kotlinx.coroutines.*

fun main() {
    println("Weather forecast")
    delay(1000)
    println("Sunny")
}
c
you are missing a coroutine scope for the
delay
to work. https://kotlinlang.org/docs/coroutines-overview.html
h
Copy code
suspend fun main() {
    println("Weather forecast")
    delay(1000)
    println("Sunny")
}
change the function to suspend function
👍 3
j
Just get on with the course and watch the execution times closely (they add up or don't...). This is just the first (anti-) example. That's how they explain the different ways to delegate different jobs and how not to do it. I was also confused at first, because the playground itself wasn't the fastest (at least on my setup.) I remember I ended up doubling the delay times to get a clearer feedback result. I also used the suggested measureTimeMillis to clearly see the different outcomes which was helpful to me.