%speed_test.m
%tests your reaction time
WaitSecs(1);
disp('Ready?');
num_sec_to_start = rand*5+1;
WaitSecs(num_sec_to_start);

disp('NOW! Press Any Button');
timer = GetSecs;
while 1
    [key_is_down, secs, key_code] = KbCheck;
    if(key_is_down)
        break
    end
end

elapsed_time = secs - timer;
disp(['Your time was ', num2str(elapsed_time)]);
