Millisecond Forums

script.elapsedtime

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

By xiller09 - 2/28/2012

Hi,


If I have an experiment that saves the script.elapsedtime value, is the value of script.elapsedtime taken as the elapsed time at the start of the trial, or at the end of the trial?


Cheers,


Tim

By xiller09 - 2/28/2012

So, I've answered my own question. It's amazing what a short walk can do for thinking skills.



It takes the time at the end of the trial. However, is it taken after a posttrial pause, or before a posttrial pause. Based on documentation I'm presuming after posttrial pause, but just wanted to confirm this.



Which leads to another question. Without computing another variable (either in script, or posthoc in excel/spss), can I get the time elapsed at the start of a trial?

By Dave - 2/28/2012

can I get the time elapsed at the start of a trial?


/ ontrialbegin = [values.myvalue=script.elapsedtime]


and log values.myvalue to data file.

By xiller09 - 2/29/2012

Excellent, thanks Dave.


Just clarifying, the script.elapsed time is reporting elapsed time before the posttrial pause. This is how it looks from my data, but just want to confirm.

By Dave - 2/29/2012

Just to confirm: Yes, it's taken before posttrial pause. Inquisit will essentially use the posttrial pause for writing the trial data to disk and cleaning up -- no more data is added at this point. See the "How to Control Trial Duration and Inter-Trial
Intervals" topic in the Inquisit documentation for a schematic overview and further details re. trial timing. You can confirm (or figure out from scratch-- great fun!) such things by e..g. running stuff like:


<expressions>
/ diff01 = abs(values.begin-values.end)
/ diff02 = abs(values.begin-script.elapsedtime)
</expressions>

<values>
/ begin = 0
/ end = 0
</values>

<trial mytrial>
/ ontrialbegin = [values.begin=script.elapsedtime]
/ ontrialend = [values.end=script.elapsedtime]
/ pretrialpause = 500
/ posttrialpause = 500
/ timeout = 1500
/ validresponse = (noresponse)
</trial>

<block myblock>
/ trials = [1-5=mytrial]
</block>

<data>
/ columns = [trialnum, values.begin, values.end, script.elapsedtime, expressions.diff01, expressions.diff02]
/ separatefiles = true
</data>


which will give you


trialnum    values.begin    values.end    script.elapsedtime    expressions.diff01    expressions.diff02
1           23              1523          1523                  1500                  1500
2           2023            3523          3523                  1500                  1500
3           4023            5523          5523                  1500                  1500
4           6023            7523          7523                  1500                  1500
5           8023            9523          9523                  1500                  1500



Regards,


~Dave