rdtsc accuracy across CPU cores

后端 未结 6 726
一生所求
一生所求 2020-11-28 22:53

I am sending network packets from one thread and receiving replies on a 2nd thread that runs on a different CPU core. My process measures the time between send & receiv

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 23:22

    On linux you can use clock_gettime(3) with CLOCK_MONOTONIC_RAW, which gives you nanoseconds resulotion and in not subject to ntp updates (if any happened).

提交回复
热议问题