CLOVIS
01/09/2023, 9:51 PMmkrussel
01/09/2023, 9:58 PMTestCoroutineScheduler
and use its currentTime
property. That way your clock always matches the time of the coroutine.CLOVIS
01/09/2023, 10:05 PMclass TestClock(private val scheduler: TestCoroutineScheduler) : Clock {
override fun now(): Instant = Instant.fromEpochMilliseconds(scheduler.currentTime)
}
It would be nice if it was available out-of-the-box thoughmkrussel
01/09/2023, 10:06 PMhfhbd
01/10/2023, 1:35 AM