Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/k6/latest/javascript-api/jslib/utils/randomintbetween.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/k6/latest/javascript-api/jslib/utils/randomintbetween/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/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.
| Parameter | Type | Description |
|---|---|---|
| min | int | Lower-end bound. Inclusive |
| max | int | Upper-end bound. Inclusive |
Returns
| Type | Description |
|---|---|
| int | Random integer |
Example
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.
}Was this page helpful?
Related resources from Grafana Labs

