title: Time measurements, CPU ticks and adjustable CPU frequency?
body: <p>These days, CPUs can adjust their frequency to lower energy consumption. However, many ways to do high precision duration measurements rely not directly on measuring time, but on getting ticks count. For example assembly instructions such as <a href="http://www.felixcloutier.com/x86/RDTSCP.xml" rel="nofollow noreferrer">RDTSC/RDTSCP</a> seem to access a tick count that is monotonically incremented at each clock cycle. Or the C constant <code>CLOCKS_PER_SEC</code> which is... a constant. For a processor with adjustable frequency, how tick counts and real durations are related? And how one can be deduced from another?</p>