---
title: "sleep(forTimeInterval:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/thread/sleep(fortimeinterval:)"
---

# sleep(forTimeInterval:)

Sleeps the thread for a given time interval.

## Declaration

```swift
class func sleep(forTimeInterval ti: TimeInterval)
```

## Parameters

- `ti`: The duration of the sleep.

## Discussion

Discussion No run loop processing occurs while the thread is blocked.

## See Also

### Stopping a Thread

- [sleep(until:)](foundation/thread/sleep(until:).md)
- [exit()](foundation/thread/exit().md)
- [cancel()](foundation/thread/cancel().md)
