Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

How to log the time of every single trial?


is it possible to log the timestamps of every single trial within the experiment? Maybe even the time in milliseconds from the beginning of the experiment to every single stimuli?

I see that I can log the time of a sketchpad or other items. But I just got one sketchpad where a list of Items will be presented one after another. Every trial shows one item and I don't need the time when the sketchpad itself is presented. I'd like to log the time when each item was presented.

Is this possible with the "logger"-item or do I need to write a script to do this?

Thanks in advance for your help.



  • Hi Christian,

    Conceptually, you cannot change a sketchpad once it is presented. That means, every time something changes on the screen, a new canvas is presented. Whether this is the same canvas but with updated information, or a entirely new canvas depends on how you implement it, but it still is always a new call to a new canvas. These events are logged automatically (unless you switch it off), so that you should have all the timestamps already. Oh, and you need to call the logger every time between calling the same objects twice. Otherwise, the timestamps will be overwritten. For different objects this does not matter.

    Hope this helps,


  • Hi Eduard,

    thanks for te fast reply.

    I tried to log all variables again and I think I overlooked a variable and you're right; the time of every trial is already logged.

    My sketchpad is called Stimulus_1, so this variable should be the timestamp of every single trial, isn't it?


  • Yup, exactly!

  • Great, thanks. :)

    There's another problem, but I'm not sure if this can be discussed here of if I should start another topic in the PyGaze forum.

    The timestamps I posted above are the times, which OpenSesame collects. The times, which are collected in the Pygaze_log are completely different. Is there a way to synchronize the times, which are logged by OpenSesame and Pygaze? I think I need to reset the time at the beginning of the experiment, so both timestaps are equal and I can match the trials from the OpenSesame-log and the Pygaze-log files.

  • Yes, pygaze and OS have different time lines, each of them starting at initialization. OS is initialized earlier than pygaze, so OS values should be larger, but if you know that delay, you can convert time lines into each other. The best way is to log OS time stamps in the eyegaze log file, or vice versa. So, with pygaze_log you can decide which variables should be written to the log file. If you include OS timestamps you can later in the analysis align the two time lines by comparing the samples to a common reference point.

    Does that make sense?

  • Yes, that makes sense, thanks. :)

    But to be honest, I don't really understand the timeline, which is logged in the pygaze_log. I posted the timeline of the OS log above and these times make sense. But in the following screenshot, you see the first lines of the eyetracker log and I can't explain how these numbers are created.

    At first I thought that I could reset both time lines at the beginning of the experiment to synchronize them, but I think this won't work as OpenSesame wouldn't reset them at the same time, but one after another, wouldn't it?

    So I think I'll try to log the OS timestamps in the pygaze_log as well. Can I just write "log (variable name)" into the pygaze_log script or do I have to do anything else?

    I got some time with the eyetracker the next two days again, so I'll give it a try.

  • Hi

    So I think I'll try to log the OS timestamps in the pygaze_log as well.

    That makes sense.

    To log variables you could use this function, in an inline_script:


Sign In or Register to comment.