Hi all. I have a timer coded in Python to terminate a loop after a certain amount of time passing. This is for a recall task, so importantly, it needs to terminate if there is no input. However, I am unable to replicate in PsychoJS to run on Pavlovia.
How did you code globalClock? If you used python then it does not work as Java does not recognise the package. You must use “globalClock = new util.Clock();” and then all the functions you normally use in python will work, such as .reset(); .getTime(), etc.
I am having the same problem, but these solutions haven’t worked for me. This code works in PsychoPy but not in Pavlovia:
Timer Routine before beginning of Loop, code snippet in Begin Routine
timer = core.Clock()
timer.reset(newT=0.0)
In the last routine in the loop, code snippet in Each Frame
t=timer.getTime()
if t > 30:
delay_loop.finished=True
continueRoutine=False
I tried changing the first code to:
globalClock = new util.Clock()
globalClock.reset(newT=0.0)
and the second to:
t=globalClock.getTime()
if t > 30:
delay_loop.finished=True
continueRoutine=False