Skip to main content

SAMPLE_OFFSET_NANOS

Constant SAMPLE_OFFSET_NANOS 

Source
pub const SAMPLE_OFFSET_NANOS: u64 = 5_000_000;
Expand description

How far behind the frame deadline pointer positions are sampled, in nanoseconds: a Move is emitted at frame_time − SAMPLE_OFFSET, slightly in the past so the two raw samples bracketing that instant are usually already in hand (interpolation, not extrapolation) at the common touch/display cadence.

Community-approximate (see docs/CODE_STANDARDS.md): Flutter’s GestureBinding resamples at a negative samplingOffset, but the exact default has drifted across engine versions and is not a published constant. ~5ms is the modest interpolate-slightly-in-the-past value community reimplementations converge on — small enough to keep input latency imperceptible, large enough to bracket a newer sample most frames.