---
title: "randomIntBetween(min, max) | Grafana k6 documentation"
description: "Random integer"
---

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

# randomIntBetween(min, max)

Function returns a random number between the specified range. The returned value is no lower than (and may possibly equal) min, and is no bigger than (and may possibly equal) max.

Expand table

| Parameter | Type | Description                |
|-----------|------|----------------------------|
| min       | int  | Lower-end bound. Inclusive |
| max       | int  | Upper-end bound. Inclusive |

### Returns

Expand table

| Type | Description    |
|------|----------------|
| int  | Random integer |

### Example

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

```javascript
import { sleep } from 'k6';
import { randomIntBetween } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js';

export default function () {
  // code ...

  sleep(randomIntBetween(1, 5)); // sleep between 1 and 5 seconds.
}
```
