SplitScript reference / Instant
Instant
record
record Instant
Identifies one reading of the runtime's monotonic clock.
Instants are suitable for elapsed-time measurements such as delayed splits and debouncing. They are unrelated to calendar time and have no meaningful absolute value.
Examples
Capture a monotonic timestamp
let detectedAt: Instant = Instant.now()
Capabilities
| Member | Description | Available through |
|---|---|---|
| Equatable | Supports equality comparison. |
Operators
| Member | Description | Available through |
|---|---|---|
| == | Reports whether this value and another value are equal. | Available through Equatable |
| != | Reports whether this value and another value differ. | Available through Equatable |
| + | Offsets this instant by a duration. |
Methods
| Member | Description | Available through |
|---|---|---|
| durationSince | Returns the elapsed duration since an earlier instant. | |
| elapsed | Returns the duration elapsed since this instant. | |
| hasElapsed | Reports whether at least the requested duration has elapsed. | |
| now | Reads the runtime's monotonic clock. |