# waitUntil(within:_:)

- **Package:** libtmux-swift
- **Language:** Swift
- **Kind:** function
- **Source:** https://github.com/libtmux/libtmux-swift/blob/254f8b2be7eb60cacc3ffcb3ea8e456784f582df/Tests/TmuxFixture/TmuxFixture.swift#L328
- **Page:** https://libtmux.org/en/swift/latest/reference/waituntil(within-_-)/

```
waitUntil(within:_:)(within: Duration, condition: () async throws -> Bool) -> Bool
```

Polls `condition` until it holds, and reports whether it did.

Bounded in wall-clock rather than in attempts. What makes one of these polls
slow is the tmux call inside it, so a count of attempts says nothing about
how long the loop can run: on a contended machine a generous-looking budget
outlives the case's time limit, and the failure reads as a timeout instead of
naming the thing that never became true.

## Raises

- `Bool`
