-
Notifications
You must be signed in to change notification settings - Fork 1
ts_ns
killown edited this page Mar 16, 2026
·
1 revision
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.
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.
-
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. -
The Timeline: By comparing the
ts nsof Frame A and Frame B, you get an absolute measurement of time that is not affected by CPU scheduling or thread sleep variations.
| 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. |
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.