Pause button during trial- timing issue when resuming

OS: Win10
PsychoPy version: 2021.2.3

I am trying to add in a pause button into the trial so if the participant needs a break or something goes wrong, I can pause the trial and then pick up where we left off.

I got it to pause using this forum, but when I hit the space button to resume, it doesn’t show the stimulus for the prescribed 4s. It speeds up through the following few stimuli presentations.

I made a dummy task to share with this problem. It just cycles through text from an excel file.

I think it’s a problem because of the psychopy clocks, but I am not sure how to fix it. Any and all help is appreciated!

testingpause.psyexp (8.9 KB)
D1Trials.xlsx (8.8 KB)