-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCheckPTB.m
More file actions
60 lines (47 loc) · 2.06 KB
/
Copy pathCheckPTB.m
File metadata and controls
60 lines (47 loc) · 2.06 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function CheckPTB
% for checking basic timing of ptb on your setup
clear Screen
numSecs = 5;
d = 100; %(80kB)
% edf's machine (intel core i7 2600 4x3.4GHz, 16GB, win7/64 sp1, discrete nvidia geforce gt 430 1GB/128bit 4.1.0, r2011b) drops about 1 frame/sec when d = 800 (5MB)
% http://www.asus.com/Graphics_Cards/NVIDIA_Series/ENGT430DI1GD3LP
% http://ark.intel.com/products/52213
% jen's machine (AMD phenom II X4 975 4x?GHz, 16GB, ubuntu 11.10/64, integrated ati radeon hd 4250, 3.3.11005, r2012a) drops about 1 frame/sec when d = 525 (2.2 MB)
% niell lab cheap stations (AMD athlon II X2 260 2x3.2GHz, 4GB, win7/32 sp1, integrated ati radeon hd 4250, 3.3.11554, r2011b) drops about 1 frame/sec when d = 375 (1.125 MB)
% http://www.asus.com/Motherboards/AMD_AM3Plus/M5A88M/
% http://www.amd.com/us/products/desktop/processors/athlon-ii-x2/Pages/AMD-athlon-ii-x2-processor-model-numbers-feature-comparison.aspx
% note 2nd core was disabled, needed BIOS update to v1001 using asus update (http://dlcdnet.asus.com/pub/ASUS/misc/utils/AsusUpdt_V71803.zip)
% also turn off catalyst a.i.
AssertOpenGL;
try
Screen('Preference', 'Verbosity', 4);
Screen('Preference', 'VisualDebugLevel', 6);
Screen('Preference', 'SuppressAllWarnings', 0);
Screen('Preference', 'SkipSyncTests', 0);
s=max(Screen('Screens'));
res=Screen('Resolution', s);
[win, winRect] = Screen('OpenWindow', s);
p=MaxPriority(win);
Priority(p);
fprintf('running at priority %d\n',p);
hz=Screen('NominalFrameRate', win, 1);
ifi=Screen('GetFlipInterval', win);
n=ceil(numSecs*hz);
t=nan(n,1);
for i=1:n
tex=Screen('MakeTexture', win, WhiteIndex(win)*(rand(d)>.5));
Screen('DrawTexture', win, tex, [], winRect, [], 0);
Screen('Close', tex);
t(i) = Screen('Flip', win);
end
plot([diff(t) repmat([ifi 1./[hz res.hz]],n-1,1)])
title('ifis')
ylabel('secs')
xlabel('frame')
legend({'measured','checked','nominal','res'})
catch e
getReport(e)
end
Screen('CloseAll');
Priority(0);
end