Join Slack
Is there a recommended amount of time to use with `delay` if I want to make sure my routine is coope...
# coroutines
w
withoutclass
02/28/2018, 3:54 PM
Is there a recommended amount of time to use with
delay
if I want to make sure my routine is cooperative, but I don't need to actually delay anything? Is 1ms too little time? Curious if there is some best practice around that yet
j
Jonathan
02/28/2018, 3:55 PM
You can use
yield()
Jonathan
02/28/2018, 3:56 PM
https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/yield.html
w
withoutclass
02/28/2018, 3:57 PM
Oh duh, need more coffee
withoutclass
02/28/2018, 3:57 PM
thanks
j
Jonathan
02/28/2018, 3:57 PM
😉
4
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by