Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

How to record time spent in different phases of a recursive loop

RvSRvS Posts: 2


I made an experiment in which participants can switch between two parts of information (two 'screens') by pressing the 'up' key. They can keep on switching until they finally make a decision (by pressing one of two other keys).
Now I want to record how much time they spend on each part of information until they make a choice. Ultimately I am interested in how much time they spent in total on each part of information.

My question is what is the best way to record this?

I am not sure what is the best way to explain my question,
but in case it helps, this screenshot shows the outline of this sequence:

The design of the solution I was thinking about:
Start by recording the time between each switch by storing a t1 - t0 calculation into a variable in both screen_first_script and screen_second_script. Then make a new t1-t0 variable each time those inline scripts are called (i.e. each time a switch is made). Then sum those variables up at the end, per screen.
If this is correct, what is the best way to let my script infinitely keep on producing new t1-t0 variables?

Or is there a better way to record the different amounts of time spent at each screen?

I hope my question makes sense!


  • sebastiaansebastiaan Posts: 2,594


    How exactly does your experiment work? That is, how/ where are they key presses collected, and how/ where is the flow of the experiment determined? Your solution seems fine, but I don't fully understand how your experiment works, so it's hard to say for sure.


    There's much bigger issues in the world, I know. But I first have to take care of the world I know.

  • RvSRvS Posts: 2


    I already implemented a way to record this, so the above question is solved for me!

    I do have one other question though: How do I call the timestamp varaibles (the 'time_ ' variables that OpenSesame produces for a sketchpad), in inline scripts?

  • eduardeduard Posts: 764


    Simply by precede them with a var.. So for example the variable time_sequence will be accessed with var.time_sequence.

    Does that make sense?


Sign In or Register to comment.