DebugBlocks

Top  Previous  Next

In addition to Activities, you can use DebugBlocks to help you very easily report the start and end of a block of statements, including timing information.  While Activities must be pushed and popped, DebugBlocks take advantage of the scoping mechanism in c++ to automatically report the start and end of blocks.

 

Inside of a function or code block {} you create a DebugBlock using:

 

JrDebugBlock("label string");

or

debugblock("label string");

 

The block will be announced at start, and automatically When the block finishes.

You can also report the current time offset within a block:

 

JrDebugBlockReport("label string");

or

debugblockreport("label string");

 

For example:

 

void myfunction()

{

debugblock("myfunction");

debugblockreport("here");

}

 

Will result in 3 messages:

"starting myfunction"

"at myfunction.here (xxx seconds)"

"finishing myfunction (xxx seconds)"