I'm using a conditional breakpoint to determine when a C#
DateTime
variable is greater than a certain time. This breakpoint will be checked approximately 50,000 times in a run.
my conditional breakpoint looks like:
quote.Time > new DateTime(2014,2,4,3,59,0)
Without this conditional break point my test run takes about 15 seconds. With the conditional breakpoint it takes 45 minutes.
Is there anything I can do to help speed this without modifying the code I'm debugging to add an assert or conditional?
Is there anyway to make it calculate the DateTime variable only once? Or is this more of an architectural issue with how conditional breakpoints are implemented in the IDE?
In most languages supported by Visual Studio, you can edit your code in the middle of a debugging session and continue debugging. To use this feature, click into your code with your cursor while paused in the debugger, make edits, and press F5, F10, or F11 to continue debugging.
You can disable all breakpoints in one of the following ways: On the Debug menu, click Disable All Breakpoints. On the toolbar of the Breakpoints window, click the Disable All Breakpoints button.
This problem occurs because ASP.NET debugging isn't enabled on the application.
Right-click the breakpoint symbol and select Conditions (or press Alt + F9, C). Or hover over the breakpoint symbol, select the Settings icon, and then select Conditions in the Breakpoint Settings window.
why don't you stop using a conditional break point and change the code until you have debugged it. so the code would become something like:
int dummyx = 0;
if (quote.Time > new DateTime (2014,2,4,3,59,0 )
{
dummyx++; // put normal break point here!
}
This will run much faster.
Just for debugging purposes I'd say create a new if-statement and a dummy variable (like int i = 0;) and set the breakpoint on that line. Then just step into / step through the rest of the code.. Just for testing, you can always just remove those 1-2 lines of code after testing.
The if-statement (logically) containing:
if (quote.Time > new DateTime(2014,2,4,3,59,0)) { int i=0; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With