This article applies to:
OnsetToOnsetTime can be used to tell how long an object was onscreen during runtime. There are cases in which OnsetToOnsetTime can be incorrectly logged as 0, even when the object was onscreen for more than 0 ms:
- A response from the participant terminates the object. OnsetToOnsetTime could be manually calculated but would largely reflect the Object.RT value. To represent the true value of an object's duration that was terminated by a response, calculate Object.RT + the next Object's .OnsetDelay.
- The object is the last or only object on a Procedure. OnsetToOnsetTime is not calculated across Procedures. This means that OnsetToOnsetTime is not calculated from the last object on a Procedure to the next object at the beginning of a Procedure (i.e., it resets for next trial). This can be manually calculated with Inline script.
The following sample demonstrates manually calculating Stimuli's OnsetToOnsetTime when the Stimulus is either the last displayed object or the only displayed object on a Procedure.
In Block1, OnsetToOnsetTime is calculated for Stimulus which is the last visible object on TrialProc. Stimulus is preceeded by the Fixation object. OnsetToOnsetTime is logged by calculating the OnsetTime of Stimulus subtracted from the OnsetTime of the next occurring Fixation. The first instance of Fixation.OnsetTime is unusable since Stimulus does not occur until after Fixation. A global variable is used to track the Stimulus.Onset Time and to perform the calculation after the following instance of Fixation.
NOTE: Because the first calculation of Stimulus.OnsetToOnsetTime cannot be done until the second trial, the logged value appears in the .edat file on the line after the belonging Stimulus occurred. For example, "ActualStimulusOnsetToOnsetTime" relative to the Stimulus presented for the first trial is logged on line 2 in the .edat file.
For the last trial of Block1, where the next object displayed after Stimulus would be Block1End, the calculation is performed once more and logged differently as this transition occurs on a different Procedural level.
Block2 is handled similarly using different named variables. Instead of handling OnsetTimes of 2 different objects, the OnsetTime of Stim is assigned to a variable before the next instance of Stim occurs. Because 2 instances of Stim are needed to perform the calculation, the first trial is ignored. The variable holding the previous Stim.OnsetTime is subtracted from the current Stim.OnsetTime. Once OnsetToOnsetTime is manually logged, the current Stim.OnsetTime is marked as the previous before the next trial.
NOTE: Because the first calculation of Stim.OnsetToOnsetTime cannot be done until the second trial, the logged value appears in the .edat file on the line after Stim occurred. Stim to Block2End is handled the same as in the first block.