# Trigger delays are highly variable and imprecise

**URL:** <https://discourse.psychopy.org/t/trigger-delays-are-highly-variable-and-imprecise/45812>\
**Category:** Builder\
**Created:** [October 17, 2025, 9:19am UTC](https://discourse.psychopy.org/t/trigger-delays-are-highly-variable-and-imprecise/45812 "2025-10-17T09:19:44Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![IRIO](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@IRIO](https://discourse.psychopy.org/u/IRIO)\
**Post date:** [October 17, 2025, 2:55pm UTC](https://discourse.psychopy.org/t/trigger-delays-are-highly-variable-and-imprecise/45812/3 "2025-10-17T14:55:55Z")

</div>

I am not sure what you mean by “static component”… I have moved up the code component where I send the triggers, hoping that it introduces less delay.

However, as I am loading each image at each trial iteration, I am not sure how can I load the image before the trial… would you have a solution for this? Should I introduce an extra routine before the routine “trial” to just load the image and then display it in the routine “trial”? Would that improve the situation?

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/b/a/bada9b825016d1ec4854a75ef50006446ad2e6a9.png)

I have another related question on how I am sending triggers… at the moment I using this function pulse, which is defined like this:

PULSE\_MS = 20 # ms

def pulse(code, dur\_ms=PULSE\_MS):  
port.setData(int(code))  
if dur\_ms and dur\_ms \> 0:  
core.wait(dur\_ms / 1000.0)  
port.setData(0)

is this ok or there are better ways of defining a trigger function?

Thank you so much for this help

---

_[View the full topic](https://discourse.psychopy.org/t/trigger-delays-are-highly-variable-and-imprecise/45812)._
