Get the offset stim of a stimulus

Hi - I am trying to build an experiment, where an image appears and then disappears when a specific hand posture is detected on the webcam (this part works quite well so far).

I would like to get the time the stimulus disappears.

If I add thisExp.addData('routine_end_time', t) to the end routine section of the code snippet is that going to work? My concern is thatt doing so I don’t have the exact same timing than with a keyboard stroke. In other words reaction time is slightly different between the keyboard and stim offset technic (30ms). Is it because of the refreshing rate?