سؤال

Is there a way to see which part of your codes are currently being executed without stopping the flow?

Currently i have invoices to process in my webpage, usually it takes about 4-5 mins to get the job done, however recently it has been slowing down quite a bit, even though its the same amount of data load.

Is there a way to track and see the process of the program through the codes? currently what I'm doing is going through breakpoints to see the speed for each invoice, however its not really feasible as i have hundreds of them to go through.

Another way which I'm currently doing is constantly refreshing the database to see the new records coming in and their time taken to process.

Currently running Visual Studio Express 2013 for web. .net 4.0

هل كانت مفيدة؟

المحلول

Litter your code with logging calls.

Put it into a method that you call.. but mark it with the Conditional attribute so that the calls are optimized out of a Release build:

[Conditional("DEBUG")] // calls are optimized away
public static void Log(string message) {
    // implement logging logic here
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top