No results for

Powered byAlgolia
⚠️ This documentation is outdated. Please visit grafana.com for the latest k6 documentation.📚

randomSeed( int )

Set seed to get a reproducible pseudo-random number using Math.random.

ParameterTypeDescription
intintegerThe seed value.

Example

Use randomSeed to get the same random number in all the iterations.

import { randomSeed } from 'k6';
export const options = {
vus: 10,
duration: '5s',
};
export default function () {
randomSeed(123456789);
const rnd = Math.random();
console.log(rnd);
}