Static Propertyswift 6.0.1_Concurrency
now
The current instant accounting for machine suspension.
- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
static var now: SuspendingClock.Instant { get }
The current instant accounting for machine suspension.
static var now: SuspendingClock.Instant { get }
import _Concurrency
struct SuspendingClock
A clock that measures time that always increments but stops incrementing while the system is asleep.
struct Instant
init()
var minimumResolution: Duration { get }
The minimum non-zero resolution between any two calls to now
.
var now: SuspendingClock.Instant { get }
The current instant accounting for machine suspension.
func sleep(until deadline: SuspendingClock.Instant, tolerance: Duration? = nil) async throws
Suspend task execution until a given deadline within a tolerance. If no tolerance is specified then the system may adjust the deadline to coalesce CPU wake-ups to more efficiently process the wake-ups in a more power efficient manner.