Here is a function for obtaining the exact RDTSC frequency on Win10+ and Linux 3.0+ for x64.
Both versions fallback to the empirical sleep-then-measure routine for OS versions that don't support directly querying the TSC frequency.

https://gist.github.com/pmttavara/6f06fc5c7679c07375483b06bb77430c