Question about how to make a fixation cross appear for various durations

Hi!
I currently find two ways of doing this

with conditions file:

create a conditions file that looks like

time
0.5
1
2

In the builder view, you create two routines, one for the fixation cross, one for your actual stimulus (or more if needed) and build a loop around them. Choose the conditions file in the loop and use $time as duration value for you fixation cross.

This will loop through all conditions the number you specify in your loop’s nReps. If you don’t want to do that try

in Coder:

For your fixation cross choose a variable duration like my_random_time and compile the coder script.
In coder, search for your variable (should look like frameRemains = 0.0 + my_random_time- win.monitorFramePeriod * 0.75) and insert the following above the while continueRoutine: statement:

    my_random_time = [0.5, 1, 2][randint(0, 3)]
    while continueRoutine:

I’m not sure about logging with this approach, or if this can be done more easily.

Best,
Robin