Skipping routine leads to blank screen of same length (time) as the skipped routine

OS - Windows 10 Education
Psychopy-2022.2.4

I have an experiment that uses a lot of loops to present the right blocks at the right time. When testing some new additions I noticed that where a 10 second routine gets skipped, it gets stuck on a blank screen that lasts 10 seconds. This may be happening elsewhere too but the 10 second gap is particularly noticable/disruptive.

I had some code in the ‘end of routine’ part which I thought could be at fault, so I moved this to the start of the next routine, but this made no difference.

This is the code, which runs at the begin of the 10 second routine. This started happening once I added the ‘trialBlock%2’ part. I added this as I only need this routine to run every other loop through.

if blocktype == 0:
    continueRoutine = False;
elif (trialBlock % 2) == 0:
    continueRoutine = False;
elif blocktype == 1:
    continueRoutine = True;


if it shows the image; blocksloop repeats twice, explanationF, vocalsF, and countDown don’t need to run the 2nd time. I suspect countDown to be the culprit causing the delay/blank screen.

Hello Beck

it is not quite obvious in which routine you added your if-else construction. Could you please be more specific?

To determine in which routine your blank screen appears, add print-statements to the begin of the routine in question.

Best wishes Jens

Hi Jens

The code is from the countDown routine, which takes 10 seconds, but almost every routine has a similar piece of code. Thank you for the suggestion for determining where the blank screen comes from. I found it to be countDown, and that routine, even when skipped, is responsible for the 10 second delay. I have noticed that other routines that are skipped, lead to similar delays, if they have a set time. I had assumed they were lag until now.

I have found a (somewhat awkward) solution. By adding a key response component which forces the end of the routine to the routine, the delay is eliminated. As long as the key component only takes a key that is extremely unlikely to be pressed, it seems to be fine.

Still it is strange that when skipping a routine of a set time, it seems to still wait for the exact length of time the routine would otherwise take.

There’s a bug in the latest version. Here’s the solution.

Add routineForceEnded = True after continueRoutine = False