Dim debug as Integer' seems a waste for a simple flag but it's faster debug=1 ' switch debugging on timer=0 Pstep 1000' call the debugger with a unique program step identifier For n=1 to 10 PStep 2000 Next j ' deliberate error, take out the j to test success Pstep 3000 Print timer ' how long did that take? Sub PStep(x As Integer) ' the debugger routine If debug Then Print "PStep ";x ' optimized for speed - change this bit to do whatever you want as part of the ' tell-tale procedure but it might get called a lot so keep that in mind End Sub