---
title: waitUntilCompleted()
framework: metal
role: symbol
role_heading: Instance Method
path: metal/mtlcommandbuffer/waituntilcompleted()
---

# waitUntilCompleted()

Blocks the current thread until the GPU finishes executing the command buffer and all of its completion handlers.

## Declaration

```swift
func waitUntilCompleted()
```

## See Also

### Waiting for state changes

- [waitUntilScheduled()](metal/mtlcommandbuffer/waituntilscheduled().md)
