The command rdtsc
should be reliable source of time if the "TscInvariant" CPUID feature is enabled (see for example this link). On a dynamic frequency rescaling context, a reliable source of time cannot be a reliable source of cycles.
On TsCInvariant-enabled CPUs: is there a way to have a reliable way to just measure cycles?