Reputation: 248
My program is using too much CPU power when I select text. And I don't know why. Normally I'd just press "Break all" to see what the program is currently doing. But in this case I'm busy selecting text with the mouse.
Is there any trick to delay the "Break all" command for a few seconds?
Upvotes: 5
Views: 356
Reputation: 16789
You can sprinkle all your suspicious code with special kind of breakpoints that do not stop execution, but print a message in Output window.
Add a breakpoint, go to Breakpoints window, find the breakpoint that was just added, right-click, select "When Hit...", in new window select "Print a message". Make sure check box "Continue execution" is checked (it should be by default). Breakpoint icon will change from circle to diamond. Repeat this for several breakpoints.
You can adjust the text that breakpoint will display to whatever you need.
Upvotes: 0
Reputation: 17328
Press CTRL-Break while selecting. This should bring the debugger up immediately.
Upvotes: 0
Reputation: 16286
you can start a separate thread with Sleep(5000); DebugBreak();
Upvotes: 8