launching `coroutine` takes more than 700+ `millis...
# coroutines
k
launching
coroutine
takes more than 700+
millis
. is it normal ? ,does
launch
builder takes that much of time?,i'm using this in android while displaying splash screen and then after 3 seconds delay closing splash
l
Showing a splash screen for 3 seconds… not a UX I'd enjoy. Anyway, see this issue: https://github.com/Kotlin/kotlinx.coroutines/issues/878 and my solution is on the bottom of this page: https://github.com/LouisCAD/Splitties/tree/61e9f223219f0c1c894be77c334d826413ed720c/lifecycle-coroutines
👍 2
k
@louiscad thanks , i will check it
a
By the way, there is an issue in the tracker about multiplatform service loaders and using objects in service loaders, so it will be probably needed anyway.
l
@altavir Do you have the link? Didn't find it on YouTrack.
a
This one I remember (it is mine): https://youtrack.jetbrains.com/issue/KT-25892
👍 1
I remember some discussion about multiplatform ServiceLoader, but can't find it.
k
@louiscad can you please tell me how i should use your slution, actually i don't understood how to apply your solution
l
@Kulwinder Singh It's a library, you need to add the dependency and use
Dispatchers.MainAndroid
in place of
Dispatchers.Main
.
k
ok, thanks👍