I am currently wanting to design a little Psychtoolbox experiment for practice purposes. The experiment involves time estimation.
It starts by showing a red circle in the middle of the screen and one would have to press the space bar after one thinks that 10secs have passed since the circle first appeared. I want to measure the reaction time (i.e. time estimation) and save this data.
Currently I use KbStrokeWait, which waits for ANY keyboard key to be pressed.
screens = Screen('Screens');
screenNumber = max(screens);
white = WhiteIndex(screenNumber);
black = BlackIndex(screenNumber);
[window, windowRect] = PsychImaging('OpenWindow', screenNumber, white);
[screenXpixels, screenYpixels] = Screen('WindowSize', window);
[xCenter, yCenter] = RectCenter(windowRect);
baseRect = [0 0 screenXpixels/4 screenXpixels/4];
maxDiameter = max(baseRect) * 1.01;
centeredRect = CenterRectOnPointd(baseRect, xCenter, yCenter);
Screen('FillOval', window, rectColor, centeredRect, maxDiameter);
However, I want it to only react to the space bar and then go on to the next part of the experiment which would be questions. I also need a function with accurate time measurement to due the kind of my experiment. I have read e.g. KbWait is not so great for timing. Due to lacking expereince I am now unsure which function would be best to use?