orbit-util / orbit.util.time

Package orbit.util.time

Types

Clock

A clock used to measure time.

class Clock

ClockUtils

object ClockUtils

ConstantTicker

class ConstantTicker

ElapsedAndResult

Represents time elapsed and the result of a computation.

data class ElapsedAndResult<T>

Stopwatch

A stopwatch for measuring elapsed time.

class Stopwatch

TimeMs

Represents a time or duration in milliseconds.

typealias TimeMs = Long

Timestamp

data class Timestamp

Extensions for External Classes

java.time.Instant

Functions

stopwatch

A stopwatch that measures the time that elapses for the given computation.

fun <T> stopwatch(clock: Clock, body: () -> T): ElapsedAndResult<T>

toInstant

fun Timestamp.toInstant(): Instant!