You need to create a clock just once, in advance, and then reset it at the moment you want to start timing from (again, just the once). The reason your timing can’t work is you are creating a clock object almost immediately before you ask it for its time, so it will always give you an answer very close to zero. So just do this: thisExp.addData('RT', t) Builder maintains a time variable called t which starts at 0 at the beginning of each routine. So what you need to do is add s…īut re the timing, it is much simpler than you are trying here. So on a 60 Hz screen, this code will take 33.4 ms to execute, rather than 16.7 ms. If you insert another one here, you will interrupt the timing of every other aspect of Builder: it’s expecting the code in this tab to be complete within one screen refresh, but you’ve just inserted a whole new pause for another refresh. Code in this tab of the code component runs once per win.flip() that Builder calls. You can still change the opacity, just don’t call win.flip(). If continueRoutine: # don't flip if this routine is over or we'll get a blank screen ThisExp.addData('clicked', stimulus1.name) TimeUsed=clock.getTime() #get the the time used by the subject to respond since a stimulus is displayed. The current code I am trying gets me odd numbers in RT (always 0.000… something).īelow is my code component for registering which image has been clicked on + my failed attempt for getting RT. I think my best option here is to add a code component to get reaction time. To get RT, Mouse.time does not work because it registers many clicks, and if I select “End routine on Press”, it registers any click, not restricting it to the image. In short, a sound is played, and participants then need to select an image and click on it with the mouse. Hi, I have created an experiment in the builder with a code component.
0 Comments
Leave a Reply. |