Negative clock cycle measurements with back-to-back rdtsc?

后端 未结 9 1210
情话喂你
情话喂你 2020-11-27 04:17

I am writing a C code for measuring the number of clock cycles needed to acquire a semaphore. I am using rdtsc, and before doing the measurement on the semaphore, I call rdt

9条回答
  •  無奈伤痛
    2020-11-27 04:30

    I tested your code on my machine and I figured that during RDTSC fuction only uint32_t is reasonable.

    I do the following in my code to correct it:

    if(before_t

提交回复
热议问题