Function x86::time::rdtsc[][src]

pub unsafe fn rdtsc() -> u64

Read the time stamp counter.

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. If software requires RDTSC to be executed only after all previous instructions have completed locally, it can either use RDTSCP or execute the sequence LFENCE;RDTSC.

Safety

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