Function core::arch::x86::_rdtsc

1.27.0· source[]
pub unsafe fn _rdtsc() -> u64
This is supported on x86 only.
Expand description

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

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

The RDTSC instruction is not a serializing instruction. It does not necessarily wait until all previous instructions have been executed before reading the counter. Similarly, 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 and RDX are cleared.

Intel’s documentation