﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 5  » How to capture the presentation time between stimuli?</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Tue, 15 Sep 2026 22:05:30 GMT</lastBuildDate><ttl>20</ttl><item><title>How to capture the presentation time between stimuli?</title><link>https://forums.millisecond.com/Topic27288.aspx</link><description>Hi there,&lt;br/&gt;&lt;br/&gt;I was trying to capture the time between when a stimulus was presented until the stimulus was replaced by another stimulus, for e.g. the stimulus gdg_67soa below.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial pic_67soa&amp;gt;&lt;br/&gt;/ stimulustimes = [&lt;br/&gt;0 = fixation_cross;&lt;br/&gt;1000 = gdg_67soa;&lt;br/&gt;1067 = mask1;&lt;br/&gt;1127 = mask2;&lt;br/&gt;1187 = mask3;&lt;br/&gt;1247 = mask4;&lt;br/&gt;1307 = mask5;&lt;br/&gt;]&lt;br/&gt;/ timeout = parameters.fixationduration + 67 + (5 * 60)&lt;br/&gt;/branch = [surveypage.word_generation]&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;values.trial_start = script.elapsedtime&lt;br/&gt;]&lt;br/&gt;/ontrialend = [&lt;br/&gt;values.img_num = picture.gdg_67soa.currentvalue;&lt;br/&gt;values.img_file = picture.gdg_67soa.currentitem;&lt;br/&gt;values.soa = 67;&lt;br/&gt;values.est_soa = script.elapsedtime - values.trial_start - 1000 - (5 * 60)&lt;br/&gt;]&lt;br/&gt;/ recorddata = true&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;span style="color: rgb(34, 34, 34); font-family: arial, tahoma; font-size: 13.3333px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;br/&gt;Here I am storing the elapsed time when the trial begins and derived the stimulus presentation time (for gdg_67soa) by using&amp;nbsp;&lt;br/&gt;script.elapsedtime - values.trial_start - 1000 - (5 * 60)&lt;br/&gt;&lt;br/&gt;I compared the derived values with the intended stimulustimes (67ms) - it is way over - double or more.&lt;br/&gt;&lt;br/&gt;However, when I turn on the /audit = true, the time seems to be very close to 67ms - this leads me to think that my derivation above could be wrong, and might include any lag that I haven't factor in. I also try /pretrialpause but it does not seem to reduce the estimation.&lt;br/&gt;&lt;br/&gt;Any comments would be much appreciated.&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;</description><pubDate>Tue, 18 Jun 2019 18:24:16 GMT</pubDate><dc:creator>zhaokoh</dc:creator></item><item><title>RE: How to capture the presentation time between stimuli?</title><link>https://forums.millisecond.com/Topic27304.aspx</link><description>&lt;div data-id="27303" class="if-quote-wrapper" unselectable="on" data-guid="1560907451149"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="27303" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="27303" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="27303" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;zhaokoh - 6/18/2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27303"&gt;&lt;div class="if-quote-message-margin"&gt;Amazing Dave. This works! Thanks for your help here. So far, I am getting very small differences (approx +/- 5ms) between actual and expected timing across different monitors so pretty happy about this, there was 1 outlier out of ~200 trials (negligible). Thanks again.&lt;a class="if-quote-goto quote-link" href="#" data-id="27303"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Cool -- thanks for letting me know!&lt;br/&gt;</description><pubDate>Tue, 18 Jun 2019 18:24:16 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: How to capture the presentation time between stimuli?</title><link>https://forums.millisecond.com/Topic27303.aspx</link><description>Amazing Dave. This works! Thanks for your help here. So far, I am getting very small differences (approx +/- 5ms) between actual and expected timing across different monitors so pretty happy about this, there was 1 outlier out of ~200 trials (negligible). Thanks again.</description><pubDate>Tue, 18 Jun 2019 17:43:56 GMT</pubDate><dc:creator>zhaokoh</dc:creator></item><item><title>RE: How to capture the presentation time between stimuli?</title><link>https://forums.millisecond.com/Topic27294.aspx</link><description>&lt;div data-id="27292" class="if-quote-wrapper" unselectable="on" data-guid="1560775592882"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="27292" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="27292" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="27292" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;Dave - 6/17/2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27292"&gt;&lt;div class="if-quote-message-margin"&gt;&lt;div data-id="27288" class="if-quote-wrapper" unselectable="on" data-guid="1560775592882"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="27288" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="27288" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="27288" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;zhaokoh - 6/14/2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27288"&gt;&lt;div class="if-quote-message-margin"&gt;Hi there,&lt;br/&gt;&lt;br/&gt;I was trying to capture the time between when a stimulus was presented until the stimulus was replaced by another stimulus, for e.g. the stimulus gdg_67soa below.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial pic_67soa&amp;gt;&lt;br/&gt;/ stimulustimes = [&lt;br/&gt;0 = fixation_cross;&lt;br/&gt;1000 = gdg_67soa;&lt;br/&gt;1067 = mask1;&lt;br/&gt;1127 = mask2;&lt;br/&gt;1187 = mask3;&lt;br/&gt;1247 = mask4;&lt;br/&gt;1307 = mask5;&lt;br/&gt;]&lt;br/&gt;/ timeout = parameters.fixationduration + 67 + (5 * 60)&lt;br/&gt;/branch = [surveypage.word_generation]&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;values.trial_start = script.elapsedtime&lt;br/&gt;]&lt;br/&gt;/ontrialend = [&lt;br/&gt;values.img_num = picture.gdg_67soa.currentvalue;&lt;br/&gt;values.img_file = picture.gdg_67soa.currentitem;&lt;br/&gt;values.soa = 67;&lt;br/&gt;values.est_soa = script.elapsedtime - values.trial_start - 1000 - (5 * 60)&lt;br/&gt;]&lt;br/&gt;/ recorddata = true&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;span style="color: rgb(34, 34, 34); font-family: arial, tahoma; font-size: 13.3333px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;br/&gt;Here I am storing the elapsed time when the trial begins and derived the stimulus presentation time (for gdg_67soa) by using&amp;nbsp;&lt;br/&gt;script.elapsedtime - values.trial_start - 1000 - (5 * 60)&lt;br/&gt;&lt;br/&gt;I compared the derived values with the intended stimulustimes (67ms) - it is way over - double or more.&lt;br/&gt;&lt;br/&gt;However, when I turn on the /audit = true, the time seems to be very close to 67ms - this leads me to think that my derivation above could be wrong, and might include any lag that I haven't factor in. I also try /pretrialpause but it does not seem to reduce the estimation.&lt;br/&gt;&lt;br/&gt;Any comments would be much appreciated.&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="27288"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;#1: The time you record /ontrialbegin is the time the trial object began executing. This is not necessarily identical to the time the trial can begin displaying stimuli. The trial has to wait for the start of the next display refresh cycle to do so.&lt;br/&gt;&lt;br/&gt;#2: Your  (5 * 60) term is idealized and assumes that your display / graphics card can actually hit those 60ms intervals precisely. Whether it can or not will depend on the display's refresh rate. You're likely accumulating error in your idealized calculation.&lt;br/&gt;&lt;br/&gt;#3: The proper method is to do something like this:&lt;br/&gt;&lt;br/&gt;/ ontrialend = [values.est_soa = picture.mask1.stimulusonset.1 - picture.gdg_67soa.stimulusonset.1]&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="27292"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;Great! Thanks Dave - I will give it a try :)</description><pubDate>Mon, 17 Jun 2019 05:46:48 GMT</pubDate><dc:creator>zhaokoh</dc:creator></item><item><title>RE: How to capture the presentation time between stimuli?</title><link>https://forums.millisecond.com/Topic27292.aspx</link><description>&lt;div data-id="27288" class="if-quote-wrapper" unselectable="on" data-guid="1560770114825"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="27288" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="27288" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="27288" title=" "&gt;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;zhaokoh - 6/14/2019&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-27288"&gt;&lt;div class="if-quote-message-margin"&gt;Hi there,&lt;br/&gt;&lt;br/&gt;I was trying to capture the time between when a stimulus was presented until the stimulus was replaced by another stimulus, for e.g. the stimulus gdg_67soa below.&lt;br/&gt;&lt;br/&gt;&amp;lt;trial pic_67soa&amp;gt;&lt;br/&gt;/ stimulustimes = [&lt;br/&gt;0 = fixation_cross;&lt;br/&gt;1000 = gdg_67soa;&lt;br/&gt;1067 = mask1;&lt;br/&gt;1127 = mask2;&lt;br/&gt;1187 = mask3;&lt;br/&gt;1247 = mask4;&lt;br/&gt;1307 = mask5;&lt;br/&gt;]&lt;br/&gt;/ timeout = parameters.fixationduration + 67 + (5 * 60)&lt;br/&gt;/branch = [surveypage.word_generation]&lt;br/&gt;/ ontrialbegin = [&lt;br/&gt;values.trial_start = script.elapsedtime&lt;br/&gt;]&lt;br/&gt;/ontrialend = [&lt;br/&gt;values.img_num = picture.gdg_67soa.currentvalue;&lt;br/&gt;values.img_file = picture.gdg_67soa.currentitem;&lt;br/&gt;values.soa = 67;&lt;br/&gt;values.est_soa = script.elapsedtime - values.trial_start - 1000 - (5 * 60)&lt;br/&gt;]&lt;br/&gt;/ recorddata = true&lt;br/&gt;&amp;lt;/trial&amp;gt;&lt;br/&gt;&lt;span style="color: rgb(34, 34, 34); font-family: arial, tahoma; font-size: 13.3333px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;"&gt;&lt;br/&gt;Here I am storing the elapsed time when the trial begins and derived the stimulus presentation time (for gdg_67soa) by using&amp;nbsp;&lt;br/&gt;script.elapsedtime - values.trial_start - 1000 - (5 * 60)&lt;br/&gt;&lt;br/&gt;I compared the derived values with the intended stimulustimes (67ms) - it is way over - double or more.&lt;br/&gt;&lt;br/&gt;However, when I turn on the /audit = true, the time seems to be very close to 67ms - this leads me to think that my derivation above could be wrong, and might include any lag that I haven't factor in. I also try /pretrialpause but it does not seem to reduce the estimation.&lt;br/&gt;&lt;br/&gt;Any comments would be much appreciated.&lt;br/&gt;&lt;br/&gt;Thanks!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="27288"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;#1: The time you record /ontrialbegin is the time the trial object began executing. This is not necessarily identical to the time the trial can begin displaying stimuli. The trial has to wait for the start of the next display refresh cycle to do so.&lt;br/&gt;&lt;br/&gt;#2: Your  (5 * 60) term is idealized and assumes that your display / graphics card can actually hit those 60ms intervals precisely. Whether it can or not will depend on the display's refresh rate. You're likely accumulating error in your idealized calculation.&lt;br/&gt;&lt;br/&gt;#3: The proper method is to do something like this:&lt;br/&gt;&lt;br/&gt;/ ontrialend = [values.est_soa = picture.mask1.stimulusonset.1 - picture.gdg_67soa.stimulusonset.1]&lt;br/&gt;</description><pubDate>Mon, 17 Jun 2019 04:21:33 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>