After reading PsychoPy documentation on timing, I came to the conclusion there are too many factors to exactly control visual stimuli display. However, I would like to time the onset and the duration of my stimuli in the most precise manner.
In my experiment, I present a series of letters for 9 frames each using a Text Component in a loop. To get onset and duration of each stimulus, I use a Code Component that does the following at the end of the routine:
# Stimulus duration in ms thisExp.addData("stimDuration", 1000 * (textTrial.tStop - textTrial.tStart)) # Stimulus onset in global clock thisExp.addData("stimOnset", textTrial.tStartRefresh)
After the experiment is run, the duration of each stimulus I get from the code lines above is between 146 ms - 155 ms (Ideally it would be 60 Hz * 9 frames = 150 ms). My question is, is this an acceptable approach to time my stimuli?
Besides, these commands seems not to work if the experiment is run online. Is there any alternative to make it work online?