Time Stamp Counter

With the advent of multi-core/hyper-threaded CPUs, systems with multiple CPUs, and hibernating operating systems, the TSC cannot be relied upon to provide accurate results — unless great care is taken to correct the possible flaws: rate of tick and whether all cores (processors) have identical values in their time-keeping registers.

Even then, the CPU speed may change because of power-saving measures taken by the OS or BIOS, or the system may be hibernated and later resumed, resetting the TSC.

Recent Intel processors include a constant rate TSC (identified by the kern.timecounter.invariant_tsc sysctl on FreeBSD or by the "constant_tsc" flag in Linux's /proc/cpuinfo).

[3] Starting with the Pentium Pro, Intel processors have practiced out-of-order execution, where instructions are not necessarily performed in the order they appear in the program.

This can cause the processor to execute RDTSC earlier than a simple program expects, producing a misleading cycle count.

[6] Thus, power management features were able to change the number of increments per second, and the values could get out of sync between different cores or processors in the same system.

Since the family 10h (Barcelona/Phenom), AMD chips feature a constant TSC, which can be driven either by the HyperTransport speed or the highest P state.

An operating system may provide methods that both use and don't use the RDTSC instruction for time keeping, under administrator control.

A Linux boot log showing the usage of TSC as system clocksource