asClock
Creates a Clock that uses the time mark at the moment of creation to determine how far the current moment is from the origin.
@JvmName(name = "fromTimeSource")fun TimeSource.asClock(origin: Instant): Clock(source)
import kotlin.time.*
import kotlin.time.TimeSource.Monotonic
fun main() {
val origin = Instant.now()
val clock = Monotonic.asClock(origin)
println("Elapsed time from origin: ${clock.elapsedNow()}")
}