Need help choosing frames or timed duration for my visual stimulus

I am right now trying to create an experiment that requires accurate visual stimulus duration. Specifically, I want a red box to appear for 2 frames or ~33ms. The original task uses frames for the duration since everything I read online says that is the way to go. I am now moving the task online and am running into a dilemma about whether I should use frames or seconds for my visual stimulus duration.

If I use frames, then I risk recruiting participants who have monitors with higher refresh rates than 60hz, which would substantially reduce the stimulus presentation time on higher hz monitors where frames happen for shorter periods of time.

If I use a timed duration, then my understanding is that I put myself at risk of occasionally having an extra frame added depending on where the refresh is at for the computer at that moment, so my stimulus would vary from either being 33ms or 50ms. Having an occasionally longer visual stimulus duration could affect performance on my task.

It seems like the most accurate solution is to measure the refresh rate of the computer and then adjust the number of frame dynamically to suit the hz of the monitor, but I have found no one else using that approach on the forums or elsewhere and I am not sure about how to make that happen off or online. Any advice on how to do this would be appreciated.

I’d also appreciate some advice on my options. Going with frames seems like I would need to omit any computer that is not 60hz, which might result in substantial lost data. Going with a timed duration seems like it would potentially add a lot of noise to my data and affect people’s performance. What do people think?

My current solution is to measure and calculate the frame data to suit the hz of the monitor. I have had good results using this method I found in an old post. But instead of the int function I decided to use the round function. I was able to flexibly adapt to the frame rate of a 60hz and 144 hz monitor with no issue. If anyone else has any suggestions or considerations, I would love to know, but as of now this is solved.

1 Like

Have you checked that expInfo frame rate works online? I know there used to be a problem with it.

It may be the same thing, but I used win.getActualFrameRate() instead of
expInfo[‘frames’] and it successfully picked up changes in the frame rate of two different computers.

If it registers different frame rates on different computers, then that sounds like it works. In older versions, the frame rate was set to a constant (60) because it wasn’t being detected.