Millisecond Forums

how to deal with delays in task

https://forums.millisecond.com/Topic34956.aspx

By nrouhani - 11/20/2022

hello, 

i am running an fMRI task that needs very precise timing and noticed there were some consistent delays for certain trial types (around 50-70 ms), i am computing the delays by calculating the difference in "trialtimestamp" between trials.

first, what is the best way to account for these delays in the script?

second, i've noticed that some trials that last 5000 ms (versus 3000 or 1000 ms of the exact same trial type, i.e., "trialcode") have 0 delay - would you know why this is (seems strangely consistent)? 

thank you so much!  
By Dave - 11/21/2022

nrouhani - 11/20/2022
hello, 

i am running an fMRI task that needs very precise timing and noticed there were some consistent delays for certain trial types (around 50-70 ms), i am computing the delays by calculating the difference in "trialtimestamp" between trials.

first, what is the best way to account for these delays in the script?

second, i've noticed that some trials that last 5000 ms (versus 3000 or 1000 ms of the exact same trial type, i.e., "trialcode") have 0 delay - would you know why this is (seems strangely consistent)? 

thank you so much!  

In general, you'll want to make use of /pre- and /posttrialpause to give trials a predictable amount of time to prepare stimuli and clean up after (deallocate memory, write data to disk, etc.).
https://www.millisecond.com/support/docs/current/html/howto/howtocontroltiming.htm

Beyond that, nothing can be said about the potential reasons for any delays without you providing the relevant code.