Package com.soywiz.klock.hr

Types

Link copied to clipboard
interface HRTimeProvider

Class to provide time that can be overridden to mock or change its behaviour.

Link copied to clipboard
value class HRTimeSpan(val nanosecondsRaw: Double) : Comparable<HRTimeSpan>

A High-Resolution TimeSpan that stores its values as nanoseconds. Just uses 52-bits and won't store decimals

Functions

Link copied to clipboard
fun HRTimeSpan.clamp(min: HRTimeSpan, max: HRTimeSpan): HRTimeSpan
Link copied to clipboard
inline fun HRTimeSpan.coalesce(block: () -> HRTimeSpan): HRTimeSpan
Link copied to clipboard
fun max(a: HRTimeSpan, b: HRTimeSpan): HRTimeSpan
Link copied to clipboard
fun min(a: HRTimeSpan, b: HRTimeSpan): HRTimeSpan

Properties

Link copied to clipboard
val TimeSpan.hr: HRTimeSpan

Converts a TimeSpan into a high-resolution HRTimeSpan

Link copied to clipboard
val HRTimeSpan.timeSpan: TimeSpan

Converts a HRTimeSpan into a low-resolution TimeSpan