Millisecond Forums

Millisecond Precise

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

By AndrewPapale - 1/9/2025

Dave,

With script.currenttime I can get an HH:MM:SS precise OS clock time, precise to seconds.  Is there any way to get this precise to milliseconds (HH:MM:SS.ss)?

Thanks,
Andrew
By Dave - 1/9/2025

Andrew Papale - 1/9/2025
Dave,

With script.currenttime I can get an HH:MM:SS precise OS clock time, precise to seconds.  Is there any way to get this precise to milliseconds (HH:MM:SS.ss)?

Thanks,
Andrew

Under Inquisit 6: No.
By AndrewPapale - 1/9/2025

Dave - 1/9/2025
Andrew Papale - 1/9/2025
Dave,

With script.currenttime I can get an HH:MM:SS precise OS clock time, precise to seconds.  Is there any way to get this precise to milliseconds (HH:MM:SS.ss)?

Thanks,
Andrew

Under Inquisit 6: No.

Is this possible in Inquisit 7?
By Dave - 1/9/2025

Andrew Papale - 1/9/2025
Dave - 1/9/2025
Andrew Papale - 1/9/2025
Dave,

With script.currenttime I can get an HH:MM:SS precise OS clock time, precise to seconds.  Is there any way to get this precise to milliseconds (HH:MM:SS.ss)?

Thanks,
Andrew

Under Inquisit 6: No.

Is this possible in Inquisit 7?

In IQJS, you can use the various methods exposed by the Date object, such as getMilliseconds().

<values>
/ myValue = null
</values>

<text myText>
/ items = ("<%values.myValue%>")
/ fontStyle = ("Arial", 2.08%, false, false, false, false, 5, 1)
</text>

<trial myTrial>
/ onTrialBegin = {
    let d = new Date();
    values.myValue = script.currentTime + ":" + d.getMilliseconds();
}
/ preTrialPause = 500
/ stimulusTimes = [1=myText]
/ validResponse = (" ")
</trial>

<block myBlock>
/ trials = [1=myTrial]
</block>

<expt myExpt>
/ blocks = [1=myBlock]
</expt>