ControllableTimer

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

Inheritors

Properties

Link copied to clipboard

The current State of the timer.

Link copied to clipboard
abstract val duration: Duration

Timer Duration.

Link copied to clipboard
abstract val state: Flow<Timer.State>

Flow of State of the timer.

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.

Link copied to clipboard
abstract suspend fun pause()

Stops the timer.

Link copied to clipboard
abstract suspend fun start()

Starts the timer.