@ExperimentalTime abstract class AbstractLongTimeSource : TimeSource
The unit in which this time source's readings are expressed.
val unit: DurationUnit
Marks a point in time on this time source.
open fun markNow(): TimeMark
Executes the given function block and returns the duration of elapsed time interval.
fun TimeSource.measureTime(block: () -> Unit): Duration
Executes the given block and returns an instance of TimedValue class, containing both the result of function execution and the duration of elapsed time interval.
fun <T> TimeSource.measureTimedValue( block: () -> T ): TimedValue<T>
A time source that has programmatically updatable readings. It is useful as a predictable source of time in tests.
class TestTimeSource : AbstractLongTimeSource
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.time/-abstract-long-time-source/index.html