-
Notifications
You must be signed in to change notification settings - Fork 0
/
05_Timing.py
43 lines (36 loc) · 1.03 KB
/
05_Timing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import psychopy.visual
import psychopy.event
import psychopy.info
win = psychopy.visual.Window(
size = [600,600],
units = "pix",
fullscr = False,
color = [1,1,1]
)
circle = psychopy.visual.Circle(
win = win,
units = "pix",
radius = 100,
fillColor = [0,0,0],
lineColor = [-1,-1,-1],
edges = 3
)
currentInfo = psychopy.info.RunTimeInfo(win=win,refreshTest='grating')
screenIFI = round(float(currentInfo['windowRefreshTimeAvg_ms']),2) #Screen Inter-Frame Interval
screenFPS = round(1000/screenIFI, 2) #Screen Frame Per Second
print(currentInfo)
numStim = 10
durStim = 500 #in ms
numFramesStim = int(durStim/screenIFI)
numFramesOff = int(screenFPS - numFramesStim)
for i in range(numStim):
for j in range(numFramesStim):
circle.radius = 100
circle.draw()
win.update()
for j in range(numFramesOff):
circle.radius = 0
circle.draw()
win.update()
circle.edges += 1
win.close()