All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.krono.Clock.kt Maven / Gradle / Ivy

There is a newer version: 3.0.14
Show newest version
@file:JsExport
@file:Suppress("NON_EXPORTABLE_TYPE")

package krono

import kotlinx.JsExport

interface Clock {

    fun currentMicrosAsLong(): Long

    fun currentMicrosAsDouble() = currentMicrosAsLong().toDouble()

    fun currentMillisAsLong() = currentMicrosAsLong() / 1_000

    fun currentMillisAsDouble() = currentMillisAsLong().toDouble()

    fun currentSecondsAsLong() = currentMicrosAsLong() / 1_000_000

    fun currentSecondsAsDouble() = currentMicrosAsLong().toDouble() / 1_000_000
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy