# The timing between turning laser on and stimulus on

**URL:** <https://mworks.discourse.group/t/the-timing-between-turning-laser-on-and-stimulus-on/951>\
**Category:** Support\
**Created:** [March 1, 2024, 8:43pm UTC](https://mworks.discourse.group/t/the-timing-between-turning-laser-on-and-stimulus-on/951 "2024-03-01T20:43:48Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [March 4, 2024, 2:58pm UTC](https://mworks.discourse.group/t/the-timing-between-turning-laser-on-and-stimulus-on/951/5 "2024-03-04T14:58:08Z")

</div>

Hi Taylor,

The issue of synchronizing the laser with a stimulus presentation has come up before. Please see [this explanation](https://mworks.discourse.group/t/laser-plug-in/870/5), which is still 100% valid. Basically, you should use approach #2 (`update_display` before `turn_laser_on`), but replace `update_display` with `update_display_and_wait`.

> There was an about 45ms difference between photodiode on and laser on. The laser was on for 300ms but the stimulus was on for over 300ms even though the stimulus\_on\_duration was 300ms. It seems like it was waiting for the stimulus drawing to be completed before turning the laser on. I’ve also attached a figure of what the traces look like this time.

This is puzzling. Can you send me the definition of the `photodiode_pixel_on` macro? Actually, it’d probably be helpful to have the whole protocol that produced this result. Can you send that as well?

Thanks,  
Chris

---

_[View the full topic](https://mworks.discourse.group/t/the-timing-between-turning-laser-on-and-stimulus-on/951)._
