Error with clock in actual version

OS (e.g. Win11):
PsychoPy version (e.g. 2022.2.4.x):
Standard Standalone? (y/n) y:

Hi all

since the update to the new version there is a problem with the following code:

begin experiment:

import time

End routine:

thisExp.addData('resp.rt', trial_1Clock.getTime()-button_t1.tStart)

The Error Message:

File “C:\Users.…\Neu_lastrun.py”, line 2062, in
thisExp.addData(‘resp.rt’, trial_1Clock.getTime()-button_t1.tStart)
NameError: name ‘trial_1Clock’ is not defined
################ Experiment ended with exit code 1 [pid:12732] #################

In the previous version, everything ran without problems. Does anyone here have an idea what this could be or what I have to do differently?

Thanks!