Skip to content

Commit cdd8608

Browse files
committed
[Concurrency] An implementation of system epochs for continuous and suspending clocks
1 parent 0897962 commit cdd8608

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

stdlib/public/Concurrency/ContinuousClock.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ extension ContinuousClock: Clock {
139139
#endif
140140
}
141141

142+
@available(SwiftStdlib 5.7, *)
143+
extension ContinuousClock {
144+
@available(SwiftStdlib 5.7, *)
145+
@backDeployed(before: SwiftStdlib 9999)
146+
public var systemEpoch: Instant { Instant(_value: .seconds(0)) }
147+
}
148+
142149
@available(SwiftStdlib 5.7, *)
143150
@_unavailableInEmbedded
144151
extension ContinuousClock.Instant: InstantProtocol {

stdlib/public/Concurrency/SuspendingClock.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,13 @@ extension SuspendingClock: Clock {
127127
#endif
128128
}
129129

130+
@available(SwiftStdlib 5.7, *)
131+
extension SuspendingClock {
132+
@available(SwiftStdlib 5.7, *)
133+
@backDeployed(before: SwiftStdlib 9999)
134+
public var systemEpoch: Instant { Instant(_value: .seconds(0)) }
135+
}
136+
130137
@available(SwiftStdlib 5.7, *)
131138
@_unavailableInEmbedded
132139
extension SuspendingClock.Instant: InstantProtocol {

0 commit comments

Comments
 (0)