Header menu logo TDesu.FSharp

UnixTime Module

Fast cached Unix timestamp — avoids repeated syscalls. Updated lazily, accurate to ~15ms (system timer resolution).

Thread-safe. The CalData reference is swapped atomically. On .NET, uses Stopwatch for high-resolution elapsed time. On Fable, falls back to UtcNow.

Functions and values

Function or value Description

UnixTime.milliseconds ()

Full Usage: UnixTime.milliseconds ()

Parameters:
    () : unit

Returns: int64 Unix milliseconds since epoch.

Current Unix timestamp in milliseconds (fast, cached).

() : unit
Returns: int64

Unix milliseconds since epoch.

UnixTime.recalibrate ()

Full Usage: UnixTime.recalibrate ()

Parameters:
    () : unit

Recalibrate from system clock. Called automatically if drift > 1 minute. Thread-safe: the CalData reference is swapped atomically.

() : unit

UnixTime.seconds ()

Full Usage: UnixTime.seconds ()

Parameters:
    () : unit

Returns: int64 Unix seconds since epoch.

Current Unix timestamp in seconds (fast, cached).

() : unit
Returns: int64

Unix seconds since epoch.

UnixTime.seconds32 ()

Full Usage: UnixTime.seconds32 ()

Parameters:
    () : unit

Returns: int32
Modifiers: inline

Current Unix timestamp in seconds as int32 (for protocols that use 32-bit timestamps).

() : unit
Returns: int32

Type something to start searching.