perf-book icon indicating copy to clipboard operation
perf-book copied to clipboard

The effort to convert TSC ticks into the nanoseconds

Open ujos opened this issue 1 year ago • 0 comments

In the book on the page 33 you mention TSC as a tool to measure the time. The problem is, there is no easy way to convert TSC ticks into the nanoseconds. I haven't found one function that works on the user level (without elevated privileges). The only way is to call QueryPerformanceCounter, then sleep, then call QueryPerformanceCounter again and measure the delta. The result is not precise.

ujos avatar Jan 01 '25 20:01 ujos