sometimes takes 30m instead of expected 4m (that were supplied as argument)?
It is observed on Android.
j
Joffrey
04/13/2022, 8:54 AM
Maybe you're running this
delay()
in a dispatcher with a limited number threads, and running blocking code in that same dispatcher at the same time, which would prevent it from resuming other coroutines. Could you please share a bit more details about those coroutines?
l
louiscad
04/13/2022, 8:54 AM
App/device put in deep sleep
👆 2
louiscad
04/13/2022, 8:55 AM
delay is based on SystemClock.uptimeMillis
louiscad
04/13/2022, 8:55 AM
Because delay is based on Handler.postDelayed which uses this clock, and doesn't itself put any wakelock
today i learned 2
m
Martin Rajniak
04/13/2022, 5:11 PM
@Joffrey thx, but probably not it, since I have reproduced with MainDispatcher and I would expect ANRs in that case
@louiscad
Thank you, that explains it.
Today I learned that delay has Android specific implementation.