Timer to know how long it took the student

I am doing a template to be able to have slides with feedback to boost learning.

I am happy so far with the feedback part. I also store good answers and bad answers. The last thing I would like to store is how long did it take the students to get 10 questions right.

I have a start button that triggers the timer but I don’t know hot to snapshot the time when the student reaches the 10 questions right.

I am trying something like this but does not work. Variable s stores right answers

totaltime=when g4.number(`s`)=10 b1.timeSincePress(100)
otherwise 0

Do I have to use a capture?

Thank you

I got it. Yes I have to use capture:

On button act9


On a note:

content:when b1.timeSincePress(100)>0 and g4.number(`s`)=10 "TIME: ${act9.lastValue("T")}"
otherwise ""