Hi,
I've created a simple C++ nanosecond timestamp reader class based on TSC, which can replace the use of clock_gettime()/chrono::high_resolution_clock::now() because it's much more efficient and stable in terms of latency: in around 10 ns for getting a ns timestamp.
Also it can sync up exactly with kernel tsc freqency by cheating.
The project is
https://github.com/MengRao/tscns. Thanks for giving advice.
Regards,
Meng