Best way to test code speed in C++ without profiler, or does it not make sense to try?

后端 未结 8 2108
忘了有多久
忘了有多久 2021-02-06 02:01

On SO, there are quite a few questions about performance profiling, but I don\'t seem to find the whole picture. There are quite a few issues involved and most Q & A ignore

8条回答
  •  萌比男神i
    2021-02-06 02:41

    Use QueryPerformanceCounter on Windows if you need a high-resolution timing. The counter accuracy depends on the CPU but it can go up to per clock pulse. However, profiling in real world operations is always a better idea.

提交回复
热议问题