المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Execution time.....??



C# Programming
04-27-2009, 03:02 PM
Hi all,
I had an application on vs2003 in c#.net.

the execution/processing speed is kind of slow.
Suppose there are methods as

dtStart = Now;//date time obj
MethodA();
.
.
MethodG();
dtEnd = Now;//date time obj

I use datetime class to find out the elapsed time as
elapsed = dtEnd - dtStart;

elapsed time is approx 2.81 sec. or always above 2.5 secs.

Is this is slow?
What these methods are doing is operating upon some string,bool,array datatypes.
mostly string manipulation.
One Big string and then extracting other string obj from this !!

but most string,bool, etc data types are local to methods, and i guess they got out of scope(eligible for garbage collection) after method lost focus.

a)How can i speed up execution?
b)Is there a way to find out which method is taking most time or culprit method/object/operation?

regards