---
title: "performAndWait(_:)"
framework: coredata
role: symbol
role_heading: Instance Method
path: "coredata/nspersistentstorecoordinator/performandwait(_:)-15ude"
---

# performAndWait(_:)

Executes the provided closure on the coordinator’s queue and waits for it to finish.

## Declaration

```swift
@preconcurrency func performAndWait<T>(_ block: @Sendable () throws -> T) rethrows -> T
```

## Parameters

- `block`: The closure to execute.

## See Also

### Performing tasks

- [perform(_:)](coredata/nspersistentstorecoordinator/perform(_:)-74udx.md)
- [perform(_:)](coredata/nspersistentstorecoordinator/perform(_:)-7jqb.md)
- [performAndWait(_:)](coredata/nspersistentstorecoordinator/performandwait(_:)-d3kq.md)
- [execute(_:with:)](coredata/nspersistentstorecoordinator/execute(_:with:).md)
