<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/SuspendingClock/Clock-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Clock Implementations"
}
-->

# Clock Implementations

## Topics

### Instance Properties

[`var minimumResolution: Duration`](/documentation/Swift/SuspendingClock/minimumResolution)

The minimum non-zero resolution between any two calls to `now`.

[`var now: SuspendingClock.Instant`](/documentation/Swift/SuspendingClock/now-swift.property)

The current instant accounting for machine suspension.

### Instance Methods

[`func measure(nonisolated(nonsending) () async throws -> Void) async rethrows -> Self.Instant.Duration`](/documentation/Swift/SuspendingClock/measure(_:)-1zuvn)

Measure the elapsed time to execute an asynchronous closure.

[`func measure(() throws -> Void) rethrows -> Self.Instant.Duration`](/documentation/Swift/SuspendingClock/measure(_:)-6nlcy)

Measure the elapsed time to execute a closure.

[`func measure(isolation: isolated (any Actor)?, () async throws -> Void) async rethrows -> Self.Instant.Duration`](/documentation/Swift/SuspendingClock/measure(isolation:_:))

[`func sleep(for: Self.Instant.Duration, tolerance: Self.Instant.Duration?) async throws`](/documentation/Swift/SuspendingClock/sleep(for:tolerance:))

Suspends for the given duration.

[`func sleep(until: SuspendingClock.Instant, tolerance: Duration?) async throws`](/documentation/Swift/SuspendingClock/sleep(until:tolerance:))

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.

### Type Aliases

[`typealias Duration`](/documentation/Swift/SuspendingClock/Duration)

### Type Properties

[`static var suspending: SuspendingClock`](/documentation/Swift/SuspendingClock/suspending)

A clock that measures time that always increments but stops incrementing
while the system is asleep.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)