---
title: "waitForEvent(_:value:)"
framework: metal
role: symbol
role_heading: Instance Method
path: "metal/mtliocommandbuffer/waitforevent(_:value:)"
---

# waitForEvent(_:value:)

Encodes a command that pauses the command buffer’s execution until another part of your app signals a shared event.

## Declaration

```swift
func waitForEvent(_ event: any MTLSharedEvent, value: UInt64)
```

## Parameters

- `event`: A shared event instance the method waits for.
- `value`: A value the method compares to the event’s value. The method returns when the event’s value is greater than or equal to value.

## See Also

### Synchronizing a command buffer

- [signalEvent(_:value:)](metal/mtliocommandbuffer/signalevent(_:value:).md)
