Tuesday, 15 January 2013

C++ high precision time measurement in Windows -


I am interested in measuring a specific point in nanosecond using C + + in Windows. Is this possible? If it is not, then at least it is possible to get specific time in Microsoft? Any library should be done, unless I think it is possible with the managed code

If you have a threaded application that is running on a multicore computer then QueryPerformanceCounter will (and will) return the different values ​​on which the core code is being executed. See the MSDN article ( rdtsc is the same problem)

This is not just a theoretical problem; We ran into it with our application and had to conclude that the only reliable time source is timegate time in which only MS is accurate (which was good enough in our case). We also tried to determine thread threads for our thread that each thread always got a consistent value from QueryPerformanceCounter , it worked, but this performance was completely killed in this app.

There is no reliable timer on those windows to include things that can be used for timing objects with minimal precision (at least one multicore computer While walking on)


No comments:

Post a Comment