Hi community,
I am running the code below on a dell XPS Laptop 15’ with a Nvidia GTX 1080 on Windows 10 (Psychopy v 3.2.4):
win = visual.Window(fullscr=True,
monitor='mathieu', color=[145,145,145], colorSpace='rgb255', units='cm')
police = 'Consolas'
win.setMouseVisible(False)
# initialize keyboard
resp = keyboard.Keyboard()
some_text = visual.TextStim(win=win,
text ="Hello world",
font=police,
pos=[0, 0],
height=0.5,
color=[0,0,0],
colorSpace='rgb255')
frame = 0
temp = np.zeros(10)
while True:
theseKeys = resp.getKeys(keyList=['space'], waitRelease=False)
if len(theseKeys):
break
some_text.draw()
t = win.flip()
if frame < 10:
temp[frame] = t
frame = frame + 1
temp = np.array(temp)
for i in range (1, 10):
print (temp[i]-temp[i-1])
core.quit()
which systematically returns abnormal duration of the first frames, e.g.:
1st run:
0.00700440000036906
0.007453700000041863
0.015575299999909475
0.01700669999991078
0.01664569999957166
0.016724900000554044
0.01652760000069975
0.01690509999934875
0.015928200000416837
2nd run:
0.004152199999225559
0.01446850000138511
0.016495099998792284
0.016586699999606935
0.016613600000709994
0.01685130000078061
0.01628999999957159
0.016707099999621278
0.017078500000934582
I have been noticing this strange behavior across many versions of psychopy and computers/LCD monitors, and I don’t understand it. I have raised this issue before, but didn’t get a clear answer. Note that there is a similar issue with the timebyframe demo:
Could you please help me understand/solve this issue? I don’t see how Psychopy’s timing of visual stimuli can be accurate given these few abnormal frame durations.
Thanks!