Function x86_64::time::rdtscp [] [src]

pub unsafe fn rdtscp() -> u64

Read the time stamp counter.

The RDTSCP instruction waits until all previous instructions have been executed before reading the counter. However, subsequent instructions may begin execution before the read operation is performed.

Volatile is used here because the function may be used to act as an instruction barrier.

Safety

  • Causes a GP fault if the TSD flag in register CR4 is set and the CPL is greater than 0.