# How to get time starting at a certain routine?

Hello everybody,
my experiment is almost done but I have one problem concerning the time.
It’s a (sub)task where the participant has to multiply two numbers and gets afterward feedback whether the answer was right or not, how many trials he has completed, how much percent he got right in total and for how long he has been doing these multiplying tasks.

So after one task the participant could see a window that looks like this for example:

The general structure of my experiment looks like this:

My problem is now, that I don’t know how to get the time that starts at the trial routine. Because right now I am using globalClock.getTime() and obviously getting the time starting from the Instr routine. Do you have any idea how I can get the time starting from the trial routine?

Thank you so much in advance!!

Here is my code if that makes it easier to understand:

In the trial routine I set the timer to 0 and then in the tracker routine in begin routine I assigned the value of globalClock to it. I tried trial.tstart.getTime() but that didn’t work.

Do you want the time taken from when the trial routine starts for the first time? If so, I’d start a new clock in End Routine of Instr.

Python: myClock = core.Clock()
JS: myClock = new util.Clock();

To get time: time=myClock.getTime() (though time might be a forbidden variable name)
To reset (if needed) myClock.reset()

Thank you so much @wakecarter! That was exactly what I was looking for!! Now it works and my experiment is done! Thank you.