Precision of psychoJS.window.callOnFlip

I would like my keyboard component to have a start point of exactly when the stimuli are presented in a routine, which in my case is on the first flip of the routine.

What is the precision of the callOnFlip? Does this function carefully check for the screen refresh as participants will see it?

In PsychoJS the precision of callOnFlip is never quite as good as locally (and is browser dependent) because it depends on the browser checking screen flip and passing back to the user. i.e. there’s an extra middle-man that isn’t there when running locally. You can see the effects of that in our timing megastudy - I think most of the variability that you see in the online platforms in the visual/response measures are caused by less-accurate flip-time measures (for all software packages)

Thanks a lot for your reply and this information @jon.

Did your timing megastudy look into how precise of a synchronization we can get between the start time of a keyboard component and the onset of stimuli? If not, can we make any conclusions about that synchronization from your megastudy?

Did your timing megastudy look into how precise of a synchronization we can get between the start time of a keyboard component and the onset of stimuli?

Yes. It’s freely available for you to read here:

Thank you @jon.

Also: does the psychoJS.window.callOnFlip function take into account frame drops?

1 Like

@jon

Suppose that the initialization of a routine takes too long and we miss a frame refresh in the beginning of a routine, then will the callOnFlip still take that into account so that the onset of the stimuli of the routine and the keyboard component zero point will be approximately synchronized?

Yes, exactly. It makes the call when the flip occurs on the graphics card, even if that is not when it was expected. This doesn’t take into account delays further down the pipeline (operating system window compositors or monitor delays)

awesome – thanks!