Running in a non-fullscreen window

Running non-fullscreen always incurs a performance hit on any operating system (may change if and when PTB uses Wayland instead of X11 as display system at some point in the future, and the specific Wayland display server supports use of direct scanout from secondary planes/overlay planes), but current Wayland is by far not ready for PTB’s general needs). Also on non-Linux, visual timing and timestamps are not to be trusted at all.

For Linux/X11 under certain conditions, and with various restrictions, the latest PTB adds experimental support to at least improve timing and possibly solve timestamping, see Psychtoolbox 3.0.18.5 Beta update "Experimental Taylor expansion" for details.

But yeah, if frame-accurate timing doesn’t matter for that windowed window, the perfomance hit for a not too big window should be not that high. You should use the ‘dontsync’ flag 1 or even 2 in Screen('Flip', win, dontclear, dontsync) in this case, so your script doesn’t get throttled in performance by that operator display and debug window.

-mario