# Randomising ISI in builder

**URL:** <https://discourse.psychopy.org/t/randomising-isi-in-builder/18257>\
**Category:** Builder\
**Tags:** timing, randomization\
**Created:** [November 19, 2020, 8:49am UTC](https://discourse.psychopy.org/t/randomising-isi-in-builder/18257 "2020-11-19T08:49:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Connor\_Turner](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@Connor\_Turner](https://discourse.psychopy.org/u/Connor_Turner)\
**Post date:** [November 19, 2020, 8:49am UTC](https://discourse.psychopy.org/t/randomising-isi-in-builder/18257/1 "2020-11-19T08:49:59Z")

</div>

Hi there,

Not much experience with PsychoPy and can’t figure out how to randomise the inter-stim interval in my go/no-go experiment, which i’ve used the keyboard response to define the duration of. Currently its set at 1s but I would like it to present the image stimulus for 100ms every time, just at random intervals between 1-2s each trial in the loop. Please let me know what I can do! Thank you. (Picture attached for context)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/d/4d515ff4340b4f88eb59830f1e4504d79cae6b79.jpeg)

---

<div class="post-metadata">

**Author:** ![TParsons](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/tparsons/32/8301_2.png) [@TParsons](https://discourse.psychopy.org/u/TParsons)\
**Post date:** [November 25, 2020, 2:09pm UTC](https://discourse.psychopy.org/t/randomising-isi-in-builder/18257/2 "2020-11-25T14:09:23Z")

</div>

You can use Python code for the Start/Stop/Duration values of components - the function `random()` will generate a random number between 0 and 1 so you can use this to pick a random time. So for a random duration of between 0 and 4 seconds you could do `random()*4`, for between 2 and 4 seconds you could do `random()*2+2`. Basically it’s `random()*(max-min)+min` (where max is the highest possible value and min is the lowest)
