Package-level declarations

Types

Link copied to clipboard
class TimerScope(var duration: Duration, var repeat: Boolean, val elapsed: Duration, val totalElapsed: Duration)

Values which can be read or modified inside a timer callback (that is, for a timer that was just triggered).

Functions

Link copied to clipboard
fun RunScope.addTimer(duration: Duration, repeat: Boolean = false, key: Any? = null, callback: TimerScope.() -> Unit)

Add a timer that will be fired as long as the current section is still running.

fun ConcurrentScopedData.addTimer(duration: Duration, repeat: Boolean, key: Any? = null, callback: TimerScope.() -> Unit)
Link copied to clipboard
fun Section.runFor(duration: Duration, onTimeElapsed: () -> Unit = {}, block: suspend RunScope.() -> Unit = {})

A run block which runs for an exact duration amount, before exiting.

Link copied to clipboard
fun Section.runForAtLeast(duration: Duration, onTimeElapsed: () -> Unit = {}, block: suspend RunScope.() -> Unit)

Like runFor, but won't violently exit the run block after the timer expires.

Link copied to clipboard
fun Section.runForAtMost(duration: Duration, onTimeElapsed: () -> Unit = {}, block: suspend RunScope.() -> Unit = {})

A run block which sets a maximum amount of time that it can run.