---
title: waitUntilScheduled()
framework: metal
role: symbol
role_heading: Instance Method
path: metal/mtlcommandbuffer/waituntilscheduled()
---

# waitUntilScheduled()

Blocks the current thread until the command queue schedules the buffer.

## Declaration

```swift
func waitUntilScheduled()
```

## Mentioned in

Preparing your Metal app to run in the background

## Discussion

Discussion This method returns after the following events: The command queue schedules (see status and MTLCommandBufferStatus.scheduled) the command buffer to run on the GPU. The command buffer invokes all the completion handlers your app submits with addScheduledHandler(_:). Use the waitUntilCompleted() method to check for completion of the scheduled work.

## See Also

### Waiting for state changes

- [waitUntilCompleted()](metal/mtlcommandbuffer/waituntilcompleted().md)
