WallClock

interface WallClock(source)

A source of wall-clock time, in milliseconds since the Unix epoch (UTC).

Experimental (implement). Implementing or delegating to this interface needs @OptIn(ExperimentalForInheritanceWebToolsApi::class); calling it and passing it are Stable Core, and the supplied WallClock.System needs no opt-in. An implementation must be safe for concurrent calls and cheap. Its reading may step backwards when the system clock is adjusted; a caller that needs a monotonic reading uses kotlin.time.TimeSource.

Inheritors

Types

Link copied to clipboard
object System : WallClock

The system clock, read from the platform.

Functions

Link copied to clipboard
abstract fun nowEpochMillis(): Long

Reads the clock.