In [[JavaScript|js]], [[Dynamic think time and pacing]] can be done using the `sleep()` function.
```js
sleep(Math.random() * 4);
```
[[Random numbers in js|Math.random()]] returns a number from 0 to less than 1, so the line above will involve a pause from 0 to less than 4 seconds.