No results for

Powered byAlgolia

sleep( t )

suggest edits

Suspend VU execution for the specified duration.

ParameterTypeDescription
tnumberDuration, in seconds.

Example

Fetching two different pages with a 0-30 second random sleep in between:

import { sleep } from 'k6';
import http from 'k6/http';
export default function () {
http.get('https://k6.io');
sleep(Math.random() * 30);
http.get('https://k6.io/features');
}