Fwiw I don't know if it's better to hardcode it but as far as I know the frequency is always the same constant. I think Microsoft attempted to change it on some Windows 10 versions, when they introduced QPC optimisations with rdtsc and the hyperv shared memory page, but then rolled back to the same old constant. There's probably too many applications out there which hradcoded it already.