<!--
{
  "availability" : [
    "macOS: 26.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CompositorServices",
  "identifier" : "/documentation/CompositorServices/LayerRenderer/Clock/wait(until:tolerance:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Compositor Services",
      "CompositorServices"
    ],
    "preciseIdentifier" : "s:So27CP_OBJECT_cp_layer_rendererC18CompositorServicesE5ClockV4wait5until9toleranceyAE7InstantV_s8DurationVSgtF"
  },
  "title" : "wait(until:tolerance:)"
}
-->

# wait(until:tolerance:)

Blocks the current thread until the specified time.

```
func wait(until deadline: LayerRenderer.Clock.Instant, tolerance: Duration? = nil)
```

## Parameters

`deadline`

The Mach absolute time at which to wake up the thread. Typically, you supply one of the predicted times associated with the current frame, such as the optimal input time.

`tolerance`

The amount of time before or after the deadline to allow the system to wake up the thread. Specifying a non-zero value lets the system shift the actual deadline to coalesce other work and achieve greater power savings.

## Discussion

Use this function to block your render loop while waiting for critical time events. For example, use it to block the thread prior to starting the submission phase for a given frame.

---

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)