# How to add random intervals

**URL:** <https://discourse.psychopy.org/t/how-to-add-random-intervals/10224>\
**Category:** Builder\
**Created:** [December 9, 2019, 12:13pm UTC](https://discourse.psychopy.org/t/how-to-add-random-intervals/10224 "2019-12-09T12:13:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![smoha005](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@smoha005](https://discourse.psychopy.org/u/smoha005)\
**Post date:** [December 9, 2019, 12:13pm UTC](https://discourse.psychopy.org/t/how-to-add-random-intervals/10224/1 "2019-12-09T12:13:13Z")

</div>

I would like to add a random interval of 100 to 500ms between the alerting (auditory beep) in the trial and the onset of the stimulus. But I can’t find anything on that.

If this template helps then use it. If not then just delete and start from scratch.

**OS** (e.g. Win10):  
**PsychoPy version** (e.g. 1.84.x):  
**Standard Standalone? (y/n)** If not then what?:  
**What are you trying to achieve?:**

**What did you try to make it work?:**

**What specifically went wrong when you tried that?:**  
Include pasted full error message if possible. “That didn’t work” is not enough information.

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/michael/32/16_2.png) [@Michael](https://discourse.psychopy.org/u/Michael)\
**Post date:** [December 9, 2019, 10:51pm UTC](https://discourse.psychopy.org/t/how-to-add-random-intervals/10224/2 "2019-12-09T22:51:49Z")

</div>

> [@smoha005](#):
>
> I would like to add a random interval of 100 to 500ms

You really need to define this with the level of detail you would use in describing it in the methods section of a paper of thesis. “Random” encompasses a lot of possibilities.

e.g. a random value sampled from the uniform distribution of values between 100 and 500 ms with a granularity of 1 screen refresh duration, drawn independently on every trial?

or discrete values of 100, 200, 300, 400, or 500 ms drawn pseudo-randomly so that each value was balanced by being presented the same number of times within a session, but with the sequence of presentation vary randomly across subjects.

or …

or …

etc
