Answer the question
In order to leave comments, you need to log in
Measuring spans of time in .NET
Faced with the task of measuring the execution time of web methods (for SAS). You need to keep a log. Simple ticking often gives similar (small) values for methods. Advise good ways to measure time. There are many calls, but all are not “heavy”, asynchronously.
Now:
long ticksStart = DateTime.Now.Ticks;
// CALL
TicksTotal = DateTime.Now.Ticks - ticksStart;
Answer the question
In order to leave comments, you need to log in
DateTime start = DateTime.Now;
// CALL
DateTime finish = DateTime.Now;
TimeSpan elapsed = new TimeSpan(start.Ticks - finish.Ticks);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question