Trying to understand coroutines better, if you use...
# announcements
k
Trying to understand coroutines better, if you use delay inside of a coroutinescope will it carry on doing other jobs on the thread during that time? Or what is the difference between delay and thread#sleep
s
Thread.sleep()
will block the thread that calls it. The thread will just sit there and do nothing until it gets interrupted and continues.
delay()
will suspend and the thread that calls it will go and do other tasks/jobs if there are any. It resumes when the delay timeout has been reached.
k
Ahh thank you very much Anton!