@@ -30,7 +30,7 @@ import Swift
30
30
///
31
31
/// For more information about specific clocks see `ContinuousClock` and
32
32
/// `SuspendingClock`.
33
- @available ( SwiftStdlibCurrentOS 5 . 7 , * )
33
+ @available ( StdlibDeploymentTarget 5 . 7 , * )
34
34
public protocol Clock < Duration> : Sendable {
35
35
associatedtype Duration
36
36
associatedtype Instant : InstantProtocol where Instant. Duration == Duration
@@ -43,7 +43,7 @@ public protocol Clock<Duration>: Sendable {
43
43
#endif
44
44
45
45
/// The traits associated with this clock instance.
46
- @available ( SwiftStdlibCurrentOS 6 . 2 , * )
46
+ @available ( StdlibDeploymentTarget 6 . 2 , * )
47
47
var traits : ClockTraits { get }
48
48
49
49
/// Convert a Clock-specific Duration to a Swift Duration
@@ -59,7 +59,7 @@ public protocol Clock<Duration>: Sendable {
59
59
///
60
60
/// Returns: A `Swift.Duration` representing the equivalent duration, or
61
61
/// `nil` if this function is not supported.
62
- @available ( SwiftStdlibCurrentOS 6 . 2 , * )
62
+ @available ( StdlibDeploymentTarget 6 . 2 , * )
63
63
func convert( from duration: Duration ) -> Swift . Duration ?
64
64
65
65
/// Convert a Swift Duration to a Clock-specific Duration
@@ -70,7 +70,7 @@ public protocol Clock<Duration>: Sendable {
70
70
///
71
71
/// Returns: A `Duration` representing the equivalent duration, or
72
72
/// `nil` if this function is not supported.
73
- @available ( SwiftStdlibCurrentOS 6 . 2 , * )
73
+ @available ( StdlibDeploymentTarget 6 . 2 , * )
74
74
func convert( from duration: Swift . Duration ) -> Duration ?
75
75
76
76
/// Convert an `Instant` from some other clock's `Instant`
@@ -82,20 +82,20 @@ public protocol Clock<Duration>: Sendable {
82
82
///
83
83
/// Returns: An `Instant` representing the equivalent instant, or
84
84
/// `nil` if this function is not supported.
85
- @available ( SwiftStdlibCurrentOS 6 . 2 , * )
85
+ @available ( StdlibDeploymentTarget 6 . 2 , * )
86
86
func convert< OtherClock: Clock > ( instant: OtherClock . Instant ,
87
87
from clock: OtherClock ) -> Instant ?
88
88
}
89
89
90
- @available ( SwiftStdlibCurrentOS 5 . 7 , * )
90
+ @available ( StdlibDeploymentTarget 5 . 7 , * )
91
91
extension Clock {
92
92
/// Measure the elapsed time to execute a closure.
93
93
///
94
94
/// let clock = ContinuousClock()
95
95
/// let elapsed = clock.measure {
96
96
/// someWork()
97
97
/// }
98
- @available ( SwiftStdlibCurrentOS 5 . 7 , * )
98
+ @available ( StdlibDeploymentTarget 5 . 7 , * )
99
99
public func measure( _ work: ( ) throws -> Void ) rethrows -> Instant . Duration {
100
100
let start = now
101
101
try work ( )
@@ -109,7 +109,7 @@ extension Clock {
109
109
/// let elapsed = await clock.measure {
110
110
/// await someWork()
111
111
/// }
112
- @available ( SwiftStdlibCurrentOS 5 . 7 , * )
112
+ @available ( StdlibDeploymentTarget 5 . 7 , * )
113
113
@_alwaysEmitIntoClient
114
114
public func measure(
115
115
isolation: isolated ( any Actor ) ? = #isolation,
@@ -127,7 +127,7 @@ extension Clock {
127
127
//
128
128
// This function also doubles as an ABI-compatibility shim predating the
129
129
// introduction of #isolation.
130
- @available ( SwiftStdlibCurrentOS 5 . 7 , * )
130
+ @available ( StdlibDeploymentTarget 5 . 7 , * )
131
131
@_silgen_name ( " $ss5ClockPsE7measurey8DurationQzyyYaKXEYaKF " )
132
132
@_unsafeInheritExecutor // for ABI compatibility
133
133
public func _unsafeInheritExecutor_measure(
@@ -140,7 +140,7 @@ extension Clock {
140
140
}
141
141
}
142
142
143
- @available ( SwiftStdlibCurrentOS 6 . 2 , * )
143
+ @available ( StdlibDeploymentTarget 6 . 2 , * )
144
144
extension Clock {
145
145
// For compatibility, return `nil` if this is not implemented
146
146
public func convert( from duration: Duration ) -> Swift . Duration ? {
@@ -171,21 +171,21 @@ extension Clock {
171
171
}
172
172
}
173
173
174
- @available ( SwiftStdlibCurrentOS 6 . 2 , * )
174
+ @available ( StdlibDeploymentTarget 6 . 2 , * )
175
175
extension Clock where Duration == Swift . Duration {
176
176
public func convert( from duration: Duration ) -> Duration ? {
177
177
return duration
178
178
}
179
179
}
180
180
181
181
#if !SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY
182
- @available ( SwiftStdlibCurrentOS 5 . 7 , * )
182
+ @available ( StdlibDeploymentTarget 5 . 7 , * )
183
183
extension Clock {
184
184
/// Suspends for the given duration.
185
185
///
186
186
/// Prefer to use the `sleep(until:tolerance:)` method on `Clock` if you have
187
187
/// access to an absolute instant.
188
- @available ( SwiftStdlibCurrentOS 5 . 7 , * )
188
+ @available ( StdlibDeploymentTarget 5 . 7 , * )
189
189
@_alwaysEmitIntoClient
190
190
public func sleep(
191
191
for duration: Instant . Duration ,
@@ -207,7 +207,7 @@ extension Clock {
207
207
/// clocks best matches the clock that the user is trying to specify a
208
208
/// time or delay in. Executors are expected to do this on a best effort
209
209
/// basis.
210
- @available ( SwiftStdlibCurrentOS 6 . 2 , * )
210
+ @available ( StdlibDeploymentTarget 6 . 2 , * )
211
211
public struct ClockTraits : OptionSet {
212
212
public let rawValue : UInt32
213
213
@@ -225,10 +225,10 @@ public struct ClockTraits: OptionSet {
225
225
public static let wallTime = ClockTraits ( rawValue: 1 << 2 )
226
226
}
227
227
228
- @available ( SwiftStdlibCurrentOS 6 . 2 , * )
228
+ @available ( StdlibDeploymentTarget 6 . 2 , * )
229
229
extension Clock {
230
230
/// The traits associated with this clock instance.
231
- @available ( SwiftStdlibCurrentOS 6 . 2 , * )
231
+ @available ( StdlibDeploymentTarget 6 . 2 , * )
232
232
public var traits : ClockTraits {
233
233
return [ ]
234
234
}
@@ -239,21 +239,21 @@ enum _ClockID: Int32 {
239
239
case suspending = 2
240
240
}
241
241
242
- @available ( SwiftStdlibCurrentOS 5 . 7 , * )
242
+ @available ( StdlibDeploymentTarget 5 . 7 , * )
243
243
@_silgen_name ( " swift_get_time " )
244
244
internal func _getTime(
245
245
seconds: UnsafeMutablePointer < Int64 > ,
246
246
nanoseconds: UnsafeMutablePointer < Int64 > ,
247
247
clock: CInt )
248
248
249
- @available( SwiftStdlibCurrentOS 5 . 7 , * )
249
+ @available( StdlibDeploymentTarget 5 . 7 , * )
250
250
@_silgen_name ( " swift_get_clock_res " )
251
251
internal func _getClockRes(
252
252
seconds: UnsafeMutablePointer < Int64 > ,
253
253
nanoseconds: UnsafeMutablePointer < Int64 > ,
254
254
clock: CInt )
255
255
256
- @available( SwiftStdlibCurrentOS 6 . 2 , * )
256
+ @available( StdlibDeploymentTarget 6 . 2 , * )
257
257
@_silgen_name ( " swift_sleep " )
258
258
internal func _sleep(
259
259
seconds: Int64 ,
0 commit comments