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
|
Full Usage:
UnixTime.milliseconds ()
Parameters:
unit
Returns: int64
Unix milliseconds since epoch.
|
Current Unix timestamp in milliseconds (fast, cached).
|
Full Usage:
UnixTime.recalibrate ()
Parameters:
unit
|
Recalibrate from system clock. Called automatically if drift > 1 minute. Thread-safe: the CalData reference is swapped atomically.
|
Full Usage:
UnixTime.seconds ()
Parameters:
unit
Returns: int64
Unix seconds since epoch.
|
Current Unix timestamp in seconds (fast, cached).
|
Full Usage:
UnixTime.seconds32 ()
Parameters:
unit
Returns: int32
Modifiers: inline |
Current Unix timestamp in seconds as int32 (for protocols that use 32-bit timestamps).
|
TDesu.FSharp