No results for

Powered byAlgolia
⚠️ This is archived documentation for v0.33. Go to the latest version

randomIntBetween(min, max)

suggest edits

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.

ParameterTypeDescription
minintLower-end bound. Inclusive
maxintUpper-end bound. Inclusive

Returns

TypeDescription
intRandom integer

Example

import { sleep } from 'k6';
import { randomIntBetween } from "https://jslib.k6.io/k6-utils/1.1.0/index.js";
export default function() {
// code ...
sleep(randomIntBetween(1, 5)); // sleep between 1 and 5 seconds.
}