What method do you use when you want to get performance data about specific code paths?
C++ – Quick and Dirty Way to Profile Code
c++code-snippetsperformanceprofiling
c++code-snippetsperformanceprofiling
What method do you use when you want to get performance data about specific code paths?
Best Answer
This method has several limitations, but I still find it very useful. I'll list the limitations (I know of) up front and let whoever wants to use it do so at their own risk.
I use this class when the problem at hand doesn't justify profiling all my code or I get some data from a profiler that I want to verify. Basically it sums up the time you spent in a specific block and at the end of the program outputs it to the debug stream (viewable with DbgView), including how many times the code was executed (and the average time spent of course)).