Strange behavior of the win.flip() function with 144hz LCD monitor

That’s not strictly the case. win.flip() has its effect almost instantaneously (it’s just flipping two buffers). What the code is actually doing above is measuring the time between creating the clock, and the win.flip() function returning. i.e. when you call win.flip(), you effectively enter a pause period, waiting for the next screen refresh to occur. i.e. this is waiting for a hardware event, its not really anything to do with how long win.flip() takes to execute. i.e. the off-screen and the offscreen buffers will be swapped almost instantly, but then the code waits until that new front buffer is actually drawn to the screen.

So the first set of results show the expected behaviour: it’s effectively random when in the current refresh interval (6.9 ms duration) the timer will be created. win.flip() is called, and so the code pauses until the next screen is displayed. The measured time should therefore be somewhere between a minimum of 0 ms and a maximum of 6.94 ms, with a mean of 3.47. @Servant_Mathieu: this apparent timing variation is of no relevance to how long the stimuli are actually displayed: if you measured from one win.flip() to the next, you’d likely find variability in the microsecond rather than millisecond range.

The stranger thing is the second set of results. That shows that something else is happening entirely. @Servant_Mathieu I wonder if your graphics card and display are capable of the new adaptive frame rate control, such as Nvidia G-Sync? In that case, calling win.flip() might actually initiate a screen refresh, rather than just wait passively for the next one on a scheduled cycle. If so, perhaps it only takes effect when PsychoPy has control of the whole screen rather than just a window?

Check this post and link for more details: