---
title: "waitForTimeout(timeout) | Grafana k6 documentation"
description: "Browser module: waitForTimeout(timeout) method"
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# waitForTimeout(timeout)

> Note
> 
> Never wait for timeout in production, use this only for debugging. Tests that wait for time are inherently flaky. Use [`Locator`](/docs/k6/latest/javascript-api/k6-browser/locator/) actions and web assertions that wait automatically.

Waits for the given `timeout` in milliseconds.

### Returns

Expand table

| Type            | Description                                          |
|-----------------|------------------------------------------------------|
| `Promise<void>` | A Promise that fulfills when the timeout is reached. |

### Example

JavaScript ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```javascript
import { browser } from 'k6/browser';

export const options = {
  scenarios: {
    browser: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
};

export default async function () {
  const page = await browser.newPage();

  await page.goto('https://test.k6.io/browser.php');
  await page.waitForTimeout(5000);
}
```
