I want to record the duration of a mouse press in my experiment. I thought I had found a pretty straightforward solution that worked offline (see code below), but the duration that is recorded for the online version is always somewhere around 0.167 (1 frame I guess?).
clock is defined at the beginning of the exp (in js code component):
sw = new util.Clock();
Each frame (in py-> auto code component):
if sound_15.status == STARTED and not mouse1.getPressed():
t1 = sw.getTime()
Any help would be appreciated.