Hi,
I am building a visual masking experiment and image presentation is very important. I need to make sure that I present images for the shortest possible duration for a 60Hz Monitor, which I believe is something like 16-17ms. I build my task in the coder. And the way I execute my presentation times is with a while loop. Something like this:
# Get images onset, show images, draw fixation cross, flip and wait
image_onset = global_clock.getTime()
current_target.draw()
current_distractor.draw()
fixation_cross.draw()
win.flip()
while global_clock.getTime() < image_onset + image_duration:
pass
# Get images offset and measure actual image duration
image_offset = global_clock.getTime()
actual_image_duration = image_offset - image_onset
print(f"Trial {i}: Image duration = {actual_image_duration}")
where image_duration=0.017
Do you think this will do what I am asking it to do or likely my code will fail in reality due to the extremely short duration I need? So having the double of that time already messes up with my task.
If you have any other solutions to my problem which may be more precise please let me know.