I am doing some real-time experiments that need low latency between each loop, and as high a frame rate as possible. On my office computer, this framerate is 60 Hz (16.7 milliseconds between frames). When I use IPython to check how long the Window.flip() function takes, however, I get double that (33.3 msecs). This makes me think that Psychopy is trying to do too much in the Window.flip() function, causing it to miss the next frame and have to wait until the next one.
Here is the code I used to test:
from pyschopy.visual import Window win = Window() %timeit win.flip() >>> 10 loops, best of 3: 33.1 ms per loop
This doesn’t occur when I use Pyglet, though:
import pyglet win = pyglet.window.Window() %timeit win.flip() >>> 100 loops, best of 3: 16.7 ms per loop
Here is some information on my setup:
- Ubuntu 14.04 64-bit
- 3 Monitors
- Python 2.7.6
- Psychopy 1.82.01
- Pyglet 1.2.4
Is there something I’m doing that is slowing down Psychopy, or is this a bug?