# Online timing issues- routine 1 restarts before routine 2 is done

**URL:** <https://discourse.psychopy.org/t/online-timing-issues-routine-1-restarts-before-routine-2-is-done/42597>\
**Category:** Online experiments\
**Tags:** timing, screen, pavlovia\
**Created:** [October 23, 2024, 10:48am UTC](https://discourse.psychopy.org/t/online-timing-issues-routine-1-restarts-before-routine-2-is-done/42597 "2024-10-23T10:48:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![DQSI](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dqsi/32/38856_2.png) [@DQSI](https://discourse.psychopy.org/u/DQSI)\
**Post date:** [October 23, 2024, 10:48am UTC](https://discourse.psychopy.org/t/online-timing-issues-routine-1-restarts-before-routine-2-is-done/42597/1 "2024-10-23T10:48:41Z")

</div>

Background info:  
I used the builder to create this experiment (Psychopy v2024.2.3). It runs fine locally, but I am having timing issues online. More specifically I have a loop that encompasses two routines, the first called “show\_pairs”, and the second “rating\_phase”.  
It looks like this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/c/3/c3319b2f7517fa4d2024f9c79eb74390512951dd.png)  
and this is my loop:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/f/9ff6368001906f713d58e64800185a24e367594d.png)

As you can see, show\_pairs has a fixed timing of 4 seconds. This is the routine setup:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/d/7/d75d8094d023f5678c3b03f1531a32f449291459.png)  
The code component there only saves the words shown to the output file, at the end of the routine.

The second routine asks participant to click on one of seven buttons (looks inelegant I know):

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/6/9643bafe3a9b5f23db7e9ac1b1c1dfd6fb41d7f9.png)  
The code here again is just used to save data to the output.

Description of the problem:  
When running online, show\_pairs restarts automatically before rating\_phase is complete. That means that, depending on how fast one clicks in the rating\_phase, they go back to a different point in show\_pairs (fixation is skipped, second word is already showing, or simply trial of show\_pairs is already completed). Basically, show\_pairs does not wait for rating\_phase to be complete in order to restart. How can I fix this timing issue? The JS code is automatically translated from the builder as I don’t know how to code in JS, but I am happy to try any solution one might have.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![JensBoelte](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jensboelte/32/9060_2.png) [@JensBoelte](https://discourse.psychopy.org/u/JensBoelte)\
**Post date:** [October 23, 2024, 10:59am UTC](https://discourse.psychopy.org/t/online-timing-issues-routine-1-restarts-before-routine-2-is-done/42597/2 "2024-10-23T10:59:06Z")

</div>

Hello

What ends the rating phase?

BTW, I would insert a short ITI between show\_pairs and rating\_phase by not starting the display of components in show\_pairs and rating\_phase at the start of the trial. But your experimental requirements may demand otherwise.

Best wishes Jens

---

<div class="post-metadata">

**Author:** ![DQSI](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dqsi/32/38856_2.png) [@DQSI](https://discourse.psychopy.org/u/DQSI)\
**Post date:** [October 23, 2024, 11:02am UTC](https://discourse.psychopy.org/t/online-timing-issues-routine-1-restarts-before-routine-2-is-done/42597/3 "2024-10-23T11:02:41Z")

</div>

Thank you for your reply.

The rating phase ends with a mouse click in the following manner:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/9/f98edf8363a93712d29023141eefde5575b757c1.png)

I could add the ITI at the start of each routine, out of curiosity what is the reason for doing so?

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [October 23, 2024, 12:11pm UTC](https://discourse.psychopy.org/t/online-timing-issues-routine-1-restarts-before-routine-2-is-done/42597/4 "2024-10-23T12:11:30Z")

</div>

I’ve been experiencing timing and loop issues in 2024.2. Try setting the version as 2024.1.4 in experiment settings and see if that helps.

---

<div class="post-metadata">

**Author:** ![DQSI](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dqsi/32/38856_2.png) [@DQSI](https://discourse.psychopy.org/u/DQSI)\
**Post date:** [October 23, 2024, 12:50pm UTC](https://discourse.psychopy.org/t/online-timing-issues-routine-1-restarts-before-routine-2-is-done/42597/5 "2024-10-23T12:50:29Z")

</div>

That worked! Thank you so much!!!
