# Reaction time with mouseclick

**URL:** <https://psychtoolbox.discourse.group/t/reaction-time-with-mouseclick/1749>\
**Category:** Uncategorized\
**Created:** [January 3, 2007, 10:48pm UTC](https://psychtoolbox.discourse.group/t/reaction-time-with-mouseclick/1749 "2007-01-03T22:48:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nialllally](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@nialllally](https://psychtoolbox.discourse.group/u/nialllally)\
**Post date:** [January 3, 2007, 10:48pm UTC](https://psychtoolbox.discourse.group/t/reaction-time-with-mouseclick/1749/1 "2007-01-03T22:48:43Z")

</div>

Hi guys im having great difficulty in coming up with the code for my  
experiment. Im presenting subjects with a series of circles that  
either appear suddenly or gradually appear and i cant seem to figure  
out how to get the reaction time during the for loop.im running on a  
windows environment.  
  
i just really need to know how to assess whether the subject has  
clicked the mouse!  
  
heres my code so far:  
  
  
Screen(w,'FillOval',[0 0 255],fixRect);  
for j=1:5;  
g=floor(18\*rand)+1;  
Screen(w,'FillOval',white,[xc(g), xd(g), yc(g), yd(g)]);  
startTime = GetSecs;   
if \*dunno what to put here  
vartimer = responseSecs-startTime;  
end  
end  
  
Thanks very much in advance  
  
Niall.

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [January 5, 2007, 11:49pm UTC](https://psychtoolbox.discourse.group/t/reaction-time-with-mouseclick/1749/2 "2007-01-05T23:49:55Z")

</div>

"help GetMouse"  
  
A different question is if a mouse is a suitable device for RT measurements.  
  
best,  
-mario  
  

> --- In [psychtoolbox@yahoogroups.com](mailto:psychtoolbox@yahoogroups.com), "nialllally" \<nialllally@...\> wrote:  
> \>  
> \> Hi guys im having great difficulty in coming up with the code for my  
> \> experiment. Im presenting subjects with a series of circles that  
> \> either appear suddenly or gradually appear and i cant seem to figure  
> \> out how to get the reaction time during the for loop.im running on a  
> \> windows environment.  
> \>   
> \> i just really need to know how to assess whether the subject has  
> \> clicked the mouse!  
> \>   
> \> heres my code so far:  
> \>   
> \>   
> \> Screen(w,'FillOval',[0 0 255],fixRect);  
> \> for j=1:5;  
> \> g=floor(18\*rand)+1;  
> \> Screen(w,'FillOval',white,[xc(g), xd(g), yc(g), yd(g)]);  
> \> startTime = GetSecs;   
> \> if \*dunno what to put here  
> \> vartimer = responseSecs-startTime;  
> \> end  
> \> end  
> \>   
> \> Thanks very much in advance  
> \>   
> \> Niall.  
> \>
