# Sleep for a fixed number of milliseconds (/guides/util/sleep)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 103 · updated: 2026-07-28 -->
Related: [Upgrade Bun to the latest version](/guides/util/upgrade.md), [Detect when code is executed with Bun](/guides/util/detect-bun.md), [Get the current Bun version](/guides/util/version.md), [Hash a password](/guides/util/hash-a-password.md), [Generate a UUID](/guides/util/javascript-uuid.md), [Encode and decode base64 data](/guides/util/base64.md)

`Bun.sleep()` returns a void `Promise` that resolves after a given number of milliseconds.

```ts
// sleep for 1 second
await Bun.sleep(1000);
```

***

Internally, it is equivalent to the following [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout) snippet.

```ts
await new Promise(resolve => setTimeout(resolve, ms));
```

***

See [Utils](/runtime/utils).
