I wanted to test how long it takes a method to run and I was wondering if timespan would be the best way to go with that? I do not want to log the start and end of the method because I heard that logging will not give an accurate time reading because of the time it takes to create and update existing log files. If timespan is not the best way any suggestions on what would be a good way to do this?
Share
It’s best to use the Stopwatch class, which was designed for this sort of thing.
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx