You don't need to use rtdsc for this... You can use any library/os specific timing functions. Timing accuracy doesn't even really matter because you can just do more iterations.
Since it's outside the main loop, it shouldn't affect compiler optimizations.