Skip to main content

saccade-time-sync

Measures how long it takes for something on this participant's screen to reach their camera, and subtracts that from every later gaze timestamp. The screen steps between two brightness levels at random moments about once a second while the camera watches. There is at most one change per second, so it is not a flickering display.

Package@saccadejs/plugin-time-sync
Browser globaljsPsychSaccadeTimeSync
Trial typesaccade-time-sync
Requiresthe extension and a running camera, so it comes after saccade-preview
WrapsrunLoopback
timeline.push({ type: jsPsychSaccadeTimeSync });

Parameters

ParameterTypeDefaultDescription
durationnumber15000Length of the measurement, in ms. Longer runs give more edges and a tighter estimate.
gap_minnumber500Minimum interval between brightness changes, in ms.
gap_maxnumber1000Maximum interval, in ms.
contrast"full" | "reduced""full""full" is black and white; "reduced" is dark grey and light grey, gentler but noisier.
instructionsHTML stringan explanation of the brightness testShown before the run.
button_textstring"Start"Text of the button that starts the measurement.
require_okbooleanfalseRerun once on an UNRELIABLE verdict. The trial continues either way.
apply_offsetbooleantrueHand the measured lag to the extension, so later trials have it subtracted.

Data

FieldTypeDescription
lag_msnumberThe measured display plus camera lag, in ms.
plateau_width_msnumberWidth of the range of lags consistent with every edge: the uncertainty. One camera frame (about 33 ms) or less is expected.
peak_dnumberHeight of the edge-difference peak, 0–1. Below 0.5 the camera did not clearly see the screen change.
halves_ms[number, number]The estimate from each half of the run.
camera_period_msnumberMean camera frame interval.
camera_jitter_msnumberIts standard deviation.
dropped_framesnumberCamera frames the browser reported dropping.
raf_period_msnumberMean animation-frame interval, effectively the display refresh.
clock_source"captureTime" | "receiveTime" | "callback"Anything but "captureTime" makes lag_ms advisory.
verdict"OK" | "INCONCLUSIVE" | "UNRELIABLE"
reasonstring | nullWhy, when the verdict is not "OK".
appliedbooleanWhether the offset was set on the extension.
rtnumberMilliseconds from trial start to the end of the measurement.

The verdict is "OK" when peak_d is at least 0.5, the plateau is at most 34 ms, and the two halves agree: within 8 ms when there are at least 15 edges per half, within 20 ms otherwise.

Example

timeline.push({
type: jsPsychSaccadeTimeSync,
contrast: "reduced",
duration: 20000,
instructions: `
<h3>One quick screen test</h3>
<p>For the next twenty seconds the background will change between dark and light every
second or so, while your camera watches the screen. It does not flash or flicker.</p>
<p>This measures how long your screen and camera take to respond, so that we can line up
what you looked at with when it appeared.</p>`,
});

See Timing and synchrony for how to read the verdict and what the correction leaves behind.