I’ve been trying to implement a timing jitter-based RNG on Linux like PCQNG. The problem is Linux doesn’t provide access to multiple independent timers like Windows does.
On Windows, QueryPerformanceCounter uses HPET, which can be sampled by another timer like TSC. This allows us to measure the timing jitter between two independent clocks.
On Linux, all timing APIs point to one single timer set on /sys/devices/system/clocksource/clocksource0/current_clocksource. It is typically set to TSC. This means we can’t do the dual-clock jitter sampling trick.
However, I just realized that mobile device sensors like accelerometers and compasses have their own internal timer. This means on mobile devices, we can sample the timing jitter between the system timer and the sensor timer.
Data Analysis
This data is the timing jitter between Google Pixel 5’s system timer and its accelerometer’s timer, reportedly running at 415.97 Hz. Each sample is the time difference between two consecutive accelerometer readings, measured in nanoseconds.
sensor-timing-jitter-noise-415.97hz-20250808164632.csv (8.0 KB)
Time Series Plot & Histogram
Distribution is roughly bell-shaped, though does not fit a normal distribution.
Autocorrelation
A strong negative autocorrelation is observed at lag-1.
I think this is expected given the sampling method that uses the end time of the previous sample as the start time for the next sample. Skipping every second sample might be able to solve this issue.
FFT
FFT analysis shows a non-flat frequency spectrum.
I published my implementation here:
Would love to hear thoughts on how this can be improved or how we can properly use this entropy for RNG or other useful purposes.











