Package-level declarations

Types

Link copied to clipboard

A Timer ticking a certain duration with the ability to start and pause.

Link copied to clipboard
typealias DelayFunction = suspend (Duration) -> Unit

A coroutine delay function.

Link copied to clipboard
class RecurringTimer(val duration: Duration, interval: Duration = 100.milliseconds, timeSource: TimeSource = TimeSource.Monotonic, delayFunction: DelayFunction = { delayDuration -> delay(delayDuration) }, coroutineScope: CoroutineScope = MainScope()) : ControllableTimer

Timer based on the system clock.

Link copied to clipboard
interface Timer

A timer ticking a certain duration.

Functions

Link copied to clipboard
suspend fun Timer.awaitFinish()

Awaits for the Timer to reach the Timer.State.NotRunning.Finished state.

Link copied to clipboard
fun Timer.elapsed(): Flow<Duration>

Duration that has elapsed while Timer.state was Timer.State.Running.