core::arch::x86_64

Function __rdtscp

1.27.0 · Source
pub unsafe fn __rdtscp(aux: *mut u32) -> u64
Available on x86-64 and (x86 or x86-64) only.
Expand description

Reads the current value of the processor’s time-stamp counter and the IA32_TSC_AUX MSR.

The processor monotonically increments the time-stamp counter MSR every clock cycle and resets it to 0 whenever the processor is reset.

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.

On processors that support the Intel 64 architecture, the high-order 32 bits of each of RAX, RDX, and RCX are cleared.

Intel’s documentation