Skip to content

Commit 836695b

Browse files
committed
Update the epoch name to systemEpoch and add some prose about how it is system relative and not globally relative
1 parent 5d58ff9 commit 836695b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

proposals/NNNN-ClockEpochs.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,32 +19,32 @@ Not all clocks have a starting point, however in these cases they do. Generally,
1919

2020
## Proposed solution
2121

22-
Two new properties will be added, one to `SuspendingClock` and another to `ContinuousClock`. Both of these properties will be the epoch for which all `Instant` types are derived from; practically speaking this is the "zero" point for these clocks.
22+
Two new properties will be added, one to `SuspendingClock` and another to `ContinuousClock`. Both of these properties will be the epoch for which all `Instant` types are derived from; practically speaking this is the "zero" point for these clocks. Since the values may be relative to the particular system they are being used on (albeit many may implement them literally as zero) they are named in accordance to reflect that they are designed to be representative of the system's sense of an epoch and should not be expected to be serializable across systems.
2323

2424
## Detailed design
2525

2626
```swift
2727
extension ContinousClock {
28-
public var epoch: Instant { get }
28+
public var systemEpoch: Instant { get }
2929
}
3030

3131
extension SuspendingClock {
32-
public var epoch: Instant { get }
32+
public var systemEpoch: Instant { get }
3333
}
3434
```
3535

3636
These can be used to gather information like for example the uptime of a system, or the active time of a system;
3737

3838
```swift
3939
let clock = ContinousClock()
40-
let uptime = clock.now - clock.epoch
40+
let uptime = clock.now - clock.systemEpoch
4141
```
4242

4343
Or likewise;
4444

4545
```swift
4646
let clock = SuspendingClock()
47-
let activeTime = clock.now - clock.epoch
47+
let activeTime = clock.now - clock.systemEpoch
4848
```
4949

5050
## ABI compatibility

0 commit comments

Comments
 (0)