Timer not stopping once video stops playing

OS: Win10, Asus
PsychoPy version: (2024.1.5.)
Standard Standalone? (y/n) If not then what?:

What are you trying to achieve?:
I have added a timer which is visible when my video is playing. However, I am trying to get my timer to stop when my video stops playing.

**What did you try to make it work?:
have tried adding the clock through the text component in the builder and matching the duration to my video, however this did not solve the problem, therefore I also tried the code component by attempting to code in the timer, this also hasn’t worked.

What specifically went wrong when you tried that?:
the timer doesn’t stop counting up after the video has stopped playing.

Follow the steps that I have mentioned below:
Add a code component.
Use core.Clock() to initialize the timer.
Update the timer text during the video’s playback.
End the routine when the video stops to ensure the timer stops counting.

Thank you for the response,
by ‘updating the timer text during the playback’ do you mean I should add a text component aswell and then set the duration of the text to match the duration of the videos?