Package-level declarations

Types

Link copied to clipboard

An exception for Date operations.

Link copied to clipboard
value class DateTime(val unixMillis: Double) : Comparable<DateTime> , Serializable

Represents a Date in UTC (GMT+00) with millisecond precision.

Link copied to clipboard

Analogous to Duration but doesn't allocate on the JS target. Important when used intensively in JS code. For example in KorGE.

Link copied to clipboard
interface TimeProvider

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

Link copied to clipboard
typealias TimeSpan = Duration

Represents a span of time, with milliseconds precision.

Properties

Link copied to clipboard

Duration representing this number as days or 86_400 seconds.

Returns the total number of days for this Duration (86_400 seconds)

Link copied to clipboard
Link copied to clipboard

Duration representing this number as hours or 3_600 seconds.

Returns the total number of hours for this Duration (3_600 seconds)

Link copied to clipboard

Return true if Duration.NIL

Link copied to clipboard

Duration representing this number as microseconds or 1 / 1_000_000 seconds.

Returns the total number of microseconds for this Duration (1 / 1_000_000 seconds)

Link copied to clipboard

Returns the total number of microseconds for this Duration (1 / 1_000_000 seconds) as Integer

Link copied to clipboard

Returns the total number of milliseconds as an Int

Link copied to clipboard

Returns the total number of milliseconds as a Long

Link copied to clipboard

Duration representing this number as minutes or 60 seconds.

Returns the total number of minutes for this Duration (60 seconds)

Link copied to clipboard

Duration representing this number as nanoseconds or 1 / 1_000_000_000 seconds.

Returns the total number of nanoseconds for this Duration (1 / 1_000_000_000 seconds)

Link copied to clipboard

Returns the total number of nanoseconds for this Duration (1 / 1_000_000_000 seconds) as Integer

Link copied to clipboard

Returns the total number of nanoseconds for this Duration (1 / 1_000_000_000 seconds)

Link copied to clipboard
Link copied to clipboard

Duration representing this number as seconds.

Returns the total number of seconds for this Duration

Link copied to clipboard
Link copied to clipboard

Duration representing this number as weeks or 604_800 seconds.

Returns the total number of weeks for this Duration (604_800 seconds)

Functions

Link copied to clipboard

Sleeps the thread during the specified time. Spinlocks on JS

Link copied to clipboard
Link copied to clipboard
inline fun Duration.coalesce(block: () -> Duration): Duration
Link copied to clipboard
operator fun Duration.compareTo(other: FastDuration): Int
Link copied to clipboard
operator fun Duration.div(other: FastDuration): Double
inline operator fun Duration.div(scale: Float): Duration
Link copied to clipboard
infix inline fun Duration.divFloat(other: Duration): Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun TimeProvider.measure(block: () -> Unit): Duration
Link copied to clipboard
inline fun TimeProvider.measureFast(block: () -> Unit): FastDuration
Link copied to clipboard
Link copied to clipboard
operator fun Duration.minus(other: FastDuration): FastDuration
Link copied to clipboard
Link copied to clipboard
operator fun Duration.plus(other: FastDuration): FastDuration
Link copied to clipboard
inline operator fun Duration.rem(other: Duration): Duration
Link copied to clipboard
operator fun Duration.times(other: FastDuration): FastDuration
inline operator fun Duration.times(scale: Float): Duration
Link copied to clipboard
inline fun TimeSpan(milliseconds: Double): Duration
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
infix inline fun Duration.umod(other: Duration): Duration
Link copied to clipboard
inline operator fun Duration.unaryPlus(): Duration