Millisecond Forums

How to record the local time?

https://forums.millisecond.com/Topic16765.aspx

By Sato - 7/22/2015

Hello.

Now, I make a Inquisit script.
I want to record the each trial's local time. For example, 10;05;26;48;05 (O'clock, minutes, seconds, milliseconds).

I want to know how to describe in <data>.


By Sato - 7/22/2015

I would like to know the times that each trial started.
By Sato - 7/22/2015

I wrote following scripts.

<data>
/ columns = [... values.currenttime, ...]
</data>
<value>
/currenttime = 0
</value>

<trial>
/ ontrialbegin = [values.currenttime = script.currenttime]
</trial>

I could display the time. However I would like to display the millisecond. 

Now, 14:24:57  [O'clock, minutes, seconds] 
Good, 14:24:57:134 [O'clock, minutes, seconds, milliseconds]
By Dave - 7/22/2015

As you already noted, the currenttime property does not include milliseconds and cannot be made to include them. Nor is there any other property that would include milliseconds in addition to hours, minutes and seconds.

If you can live with *relative* time elapsed (in milliseconds) since the script started executing, you can use the script.elapsedtime property.
By Sato - 7/23/2015

Dear Dave,
Thanks for your reply.

I understand.
I wanted to know the absolute time to synchronize with the eye tracking data.

In order to know the pupil size of each trial, to buy Toby of plug-in, and I have to make scripts like following?

<eyetracker>
/ plugin = "tobii"
</eyetracker>


<data>
/ columns = [...values.maxpupilheight]
</data>

<trial>
ontrialbegin = [values.maxpupilheight = eyetracker.maxpupilheight]
</trial>

<value>
/maxpupilheight = 0
</value>

By Dave - 7/23/2015

Glancing over it, that code looks okay to me. You'd usually want to read out the maxpupilheight property /ontrialend, though, not /ontrialbegin. You can find example eye tracking / Tobii scripts here:

https://www.millisecond.com/download/library/Tobii/

Those should be helpful in terms of how to approach different paradigms / using the <eyetracker> element and its properties.
By Sato - 7/23/2015

Thanks for your reply.

I was understand that ontrialend is better than ontrialbegin.
Okey?

How different Do these two data have?
By Dave - 7/23/2015

Any /ontrialbegin logic is executed at the very start of a given <trial>, i.e., before anything has happened in that trial. At this point no stimuli have been displayed, no responses have been collected etc. As such, the maximum pupil height at this point would seem to be not that interesting.

/ontrialend logic is executed at the end of a given <trial>, i.e., after stimuli have been shown, responses collected, etc. At this point, the maximum pupil height would seem to be much more meaningful and interesting, I would think.

At any rate, though, there is nothing that prevents you from doing both. I.e.

<trial sometrial>
/ ontrialbegin = [values.maxpupilheight_start = eyetracker.maxpupilheight; ]
/ ontrialend = [values.maxpupilheight_end = eyetracker.maxpupilheight; ]
...
</trial>

<data>
/ columns = [..., values.maxpupilheight_start, values.maxpupilheight_end, ...]
...
</data>
By Sato - 7/23/2015

Thank you very much!
Your comments were very useful!