Call routineTimer.reset() in win.callOnFlip()?


I created a task in the Builder and have noticed that the onset of the first stimulus is delayed by tens of milliseconds. I believe this is because routineTimer.reset() is called before the window has flipped. Would it be OK to call routineTimer.reset() in win.callOnFlip() (i.e., replace routineTimer.reset() at the end of the routine with win.callOnFlip(routineTimer.reset())? This would ensure that routineTimer begins when the first stimulus is displayed on the screen – are there any issues here I haven’t anticipated?

Thank you.

Could you call routineTimer.reset() in Each Frame using if frameN == 0: