<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "Tor",
  "identifier" : "/documentation/Tor/TorSession/waitUntilBootstrapped(timeout:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Tor"
    ],
    "preciseIdentifier" : "s:3Tor0A7SessionP21waitUntilBootstrapped7timeoutys8DurationV_tYaKF"
  },
  "title" : "waitUntilBootstrapped(timeout:)"
}
-->

# waitUntilBootstrapped(timeout:)

Block until Tor reports 100% bootstrap progress, or fail after
`timeout`.

```
func waitUntilBootstrapped(timeout: Duration) async throws
```

## Parameters

`timeout`

Maximum `Duration` to wait before throwing.

## Discussion

Bootstrap progress is driven by the Tor control-protocol
`status/bootstrap-phase` `GETINFO` key (control-spec.txt §3.9) and
surfaces as [`TorEvent.bootstrap(progress:tag:summary:)`](/documentation/Tor/TorEvent/bootstrap(progress:tag:summary:)) on the [`events`](/documentation/Tor/TorSession/events) stream.
Typical cold-boot bootstrap on a public guard takes 30–60 seconds;
a warm boot with a reused `cacheDirectory` can complete in 5–10
seconds (see `TorConfiguration.cacheDirectory` performance tip).

> Throws: ``doc://Tor/documentation/Tor/TorError/timeout`` when `timeout` elapses before 100%
> bootstrap is reached, and ``doc://Tor/documentation/Tor/TorError/notStarted`` if the session
> is idle/stopped when invoked.

> Note: Progress is strictly monotonic — an event at 75% implies
> every lower-percentage event has already been delivered.