Total duration of stroop task

PsychoPy version (e.g. 1.84.x): 2023.2.2

after several searches and tests, I post here because I have not found the solution
I created my first task under builder: a stroop
I can not get the total time of the test and I would like it to be displayed in the data file provided by the software.
I did not set a response time for the participant

I added a “Start” routine at the very beginning of my experiment with the following code in “Begin Routine”:


then added an “end” routine at the very end with the following code in “Begin Routine”:

totalTime = globalClock.getTime()
thisExp.addData('totalTime', totalTime)

and in my input csv file I added a totalTime column

What is wrong ? can you help me ?

Why did you do this? I think it could be overwriting your code.

I just deleted the column but my exp does not launch, I have the following error:

totalTime = globalClock.getTime()
AttributeError: ‘NoneType’ object has no attribute ‘getTime’

what is the way to have the total time of an experience?

Instead of using globalClock, create your own clock

Begin Experiment
myClock = new core.Clock()

Begin Routine

Begin Routine (final routine)
thisExp.addData('totalTime', myClock.getTime())

in “Start” routine at the very beginning of my experiment
“Begin experiment”: myClock = new core.Clock()
“Begin Routine”: myClock.reset()
in “end” routine at the very end
“Begin experiment”: nothing
“Begin Routine”: thisExp.addData(‘totalTime’, myClock.getTime())

Is that or I don’t understand ?
Because when I do that I have an error

myClock = new core.Clock()

SyntaxError: invalid syntax

and when a delete the space I have an other error :
myClock = newcore.Clock()
NameError: name ‘newcore’ is not defined

Sorry – it’s just myClock = core.Clock()

It translates to myClock = new util.Clock() which is where I got confused

ok thank you
my exp is working properly
where is the total exp time displayed?
in the output file, I have this
I want the “response.rt” to be added automatically

What file is that? I don’t recognise the format of the extra info.

I look at the participant CSV file.

for each exp, I have this 4 files automatically created and I open the xls file wich contains the same informations than csv (screen in last message)
you havn’t that ?
where do you find the csv participant file ?

I only get three files. What does the other CSV file look like?

here the other csv file wich contains the same informations than other csv
you havn’t that ?

That one looks right, except you need to open it in columns. Sometimes I find it works better to double click on the file to open instead of opening it from Excel. However, you might also have an issue with comma as your decimal separator.

thank you for your help
I have now a colomn “total time” and some others depending on the place I put the routines