Skip to content
killown edited this page Mar 16, 2026 · 1 revision

Metric: ts ns (The Raw Timestamp)


Executive Summary

ts ns is the raw, high-precision nanosecond timestamp of the moment the frame was officially presented to the display. This is the "Source of Truth" generated by the Linux Kernel's DRM subsystem.

  • Format: Raw integer (nanoseconds).
  • Source: Hardware-level interrupt (DRM_EVENT_FLIP_COMPLETE).
  • Precision: Sub-microsecond.

Why this number matters

While delta ms or FPS are derived values, ts ns is the original data point. Every calculation in your OSD, including drift, slack, and pacing, is born from this number.

  1. Zero Noise: Unlike app-level timers (Instant::now()), this timestamp is recorded by the kernel the instant the GPU hardware finishes the page flip. It bypasses all application and window manager lag.
  2. The Timeline: By comparing the ts ns of Frame A and Frame B, you get an absolute measurement of time that is not affected by CPU scheduling or thread sleep variations.

Troubleshooting

Observation Meaning The Reality
Large gaps between ts ns A dropped frame. The hardware waited for a full extra refresh cycle before flipping.
Inconsistent increments Unstable pacing. The "beat" of your application is shifting, even if the average speed looks okay.
Perfectly even increments Total synchronization. Your app is perfectly phase-locked with the monitor's crystal oscillator.

The Specialist Insight

In the world of professional graphics, ts ns is the only value that cannot be "faked." If you are writing a benchmark or a compositor, you rely on this hardware-stamped value to prove that your software is doing what it claims to do. It is the "Finish Line" camera for every frame you render.

Clone this wiki locally