How do timers work?

I have seen that many subroutines -- or, if you like C++-speak, class member functions -- have start and stop timer functions at the beginning and end of their code block. Their purpose is clear.

I wondered what happens when I use timers in a subroutine called by another subroutine that already has timers. The subroutines are nested in a way.

Does the pair of timers in the parent subroutine count the time spent while delegating the work to the child subroutine? Or should I activate the timing for each and every subroutine?

Of course my aim is to avoid both double counting and misses in the total compute time spent on a certain tasks. Thanks in advance for considering this question.

Sign In or Register to comment.