import Foundation /// A testable sleep seam for phase timeouts. public protocol AsyncSleeper: Sendable { /// Sleeps for the duration, or throws `CancellationError` when the task is cancelled. func sleep(for duration: Duration) async throws } /// The production sleeper backed by the continuous clock. public struct ContinuousClockSleeper: AsyncSleeper { /// Creates a continuous-clock sleeper. public init() {} /// Sleeps for the duration, or throws `CancellationError` when the task is cancelled. public func sleep(for duration: Duration) async throws { try await Task.sleep(for: duration) } }