Hi everyone.
I would like to start a clock at the beginning of my experiment and then at certain points throughout the experiment - write the current time of that clock to my output file. Hence I would be able to see, ‘oh this participant started this section very quickly’ etc… as a seperate thing to the RTs of specific trials.
(Oh and I have disabled all the ‘save offset.onset’ times for objects because I found these just cluttered up my output file enormously - and I would like to control what I log.
So. I created a clock in the ‘Begin experiment’ tab of an early routine in my experiment.
ExpClock = core.Clock()
And then added this line to the ‘Each frame’ tab (of the same routine):
ExpClockText.text = ExpClock.getTime()
Which all works just fine - the text object dynamically updates to show the elapsed time. Nice.
I then tried adding a similar textobject to subsequent routines and added the following to the text field of these objects within builder:
$ExpClock.getTime()
I was expecting to see the elapsed time when the routine begins (not dynamic) on this text object for any subsquent screens and then I would begin to think about capturing this variable and writing it to my output file when I wanted to.
But…
Instead for these subsequent screens, the value displayed is always short - like a second or so - and the same for every subsequent screen - as if the clock were being reset somehow.
So my question is - how can I get a clock to begin early on and be able to reference it subsequently in different routines to see elapsed time?
Follow up question: I then tried uploading this experiment to Pavlovia - which threw an error so I looked at @wakecarter’s cribsheet - and saw that I need to use differnet syntax for clocks in the JS panel. So I did this and it worked - BUT… at this point - the two panels become disconnected right? So if I want to do ANYTHING listed on that crib sheet - I from that point forth need to update the code in BOTH panels. Is that right? Meaning at this point - I need to learn Javascript as well? Am I getting this wrong - coz that would be… er… less than desirable.
Thanks for any pointers on either of these two issues.
Regards,
Dan.