Timings reported by Profiler far exceed actual runtimes
Here is the scenario:
I am profiling code that loads 598 documents into a database. When I run this routine from start to finish it only takes about 6 seconds. I've timed this with both a stop watch and TimeSpan objects in the code. However, when I profile the same code the method being timed reports that the method takes approximately 2 to 3 times longer than what is possible.
Any thoughts on what I am not seeing here? The counts look fine, but timings appear greatly inflated.
When I look through all the methods and their timings everything makes sense except for this:
XmlValidatingReader xvr = new XmlValidatingReader(xrd);
The last line of code is reported as taking up 5.75 seconds which isn't possible. It is part of System.Xml namespace in .NET 1.1.
If I take this value out of the equation then the timing values across the board add up to the actual runtime of the method I was testing.