DP_Debug:
Using Timers

Back to the Main Page

All of these examples assume that the library has been imported as noted in the Documentation.

Timers allow you to explore code performance. To set a timer use the timer() method:

DP_Debug.timer("MyTimer");

Call the method again with the same timer name to stop the timer and output the duration:

DP_Debug.timer("MyTimer");

The following example shows a timer being set around a block of potentially slow code:

	DP_Debug.timer("MyTimer");
	for (Cnt = 0; Cnt < 10000; Cnt++) { X = Cnt };
	DP_Debug.timer("MyTimer");
	

You can: