clock.time() returns zero
If you fill out the information below, we will be able to help you better. 😎 You can also consider asking SigmundAI.eu, our AI assistant with expert knowledge of OpenSesame.
OpenSesame version
4.0.37
Operating system
Win 11
If you are running an online experiment, also provide the browser version.
Backend legacy
In a OS inline script we use clock.time() to keep track of the actual time during the experiment.
We have a block loop with a nested trial loop inside. For the first itteration of the block loop, all works well. In the second itteration of the block loop the clock.time() function returns a zero after several itteration of the trial loop. For that trial, all other timers (e.g. for a keyboard response item or a sketchpad to display a stimulus) report a zero value in the log file as well. The program "halts" on the keyboard response collection. It will only continue after we press a button. In other words the timeout for the keyboard response fails as well.
Once we force the program to continue by pressing a button, the clock.time() function works as expected for many subsequent trials. It does not get reinitialized. All trials in the current block itteration finish. However, in the next block iteration the problem occures again.
When we run the experiment again, the same issue arises at the same trial(s).
Changing backend did not help. tried to run the program on different laptops. Switching to a mac instead of windows did not help either.
It is possible to share the code via github.
Any clue, suggestion on what is happening?
Thanks for thinking along,
Remco Renken
Comments
Hi @RemcoRenken
That’s indeed a strange issue. So, just to clarify: the zeros appear only for one specific line in your block table, always the same one? If you remove that line, does the experiment run without problems? Or is it more that it always happens at the same trial number?
It would definitely help if you could share your experiment file so I can take a closer look.
Claire
Check out SigmundAI.eu for our OpenSesame AI assistant! 🤖
Hi @Claire
Removing a specific line inside the csv defining the trials did not help. The issue occurs at the same trial number. NB switching csv files alltogether (e.g. making the experiment longer or shorter) does change the trial number at which the issue occurs.
We've attached the OS file, as well as a logfile. Inside the logfile the issue can be found in line: 253 in the quickrun.csv file
Thank you for thinking along.
Remco
Hi @RemcoRenken
Thanks again for sharing your files.
I tried running your experiment and for me, it consistently froze at trial 253. Each time, it would halt at the same point and I had to abort the experiment.
However, when I switched the backend to PsychoPy, the issue disappeared. The experiment then ran smoothly without freezing or returning zero values for the timers. So I'm not sure what's happening, possibly some compatibility issues between legacy and the clock.time() function...
Perhaps you could try that too (switching to PsychoPy as the backend), and see if that solves the issue on your end as well?
Claire
Check out SigmundAI.eu for our OpenSesame AI assistant! 🤖
Thank you,
I have made some further updates to the program, as well as switching the backend to PsychoPy. Now the issue seems to be solved. Given your comment, it seems that switching the backend was paramount.
Thank you once more.
Remco