I've been using the gprof
profiler in conjunction with g++
.
I have a function in my code which encapsulates several sections of behaviour which are related enough to the primary function that it would not make sense to split them off into their own functions.
I'd like to know how much time is spent in each of these areas of code.
So, if you imagine the code looks like
function(){
A
A
A
B
B
B
C
C
C
}
where A, B, and C represent particular sections of code I'm interested in, is there a way to get gprof
to tell me how much time is spent working on those particular sections?