I am using asp.net mvc 2.0 and I want to test how long it takes to execute some of my code.
In one scenario I do this
- load xml file up.
- validate xml file and deserailze.
- validate all rows in the xml file with more advanced validation that cannot be done in the schema validation.
- then I do a bulk insert.
I want to measure how long steps 1 to 3 take and how long step 4 takes.
I tried to do like DateTime.UtcNow
in areas and subtract them but it told me it took like 3 seconds but I know that is not right as steps 1 to 4 take 2mins to do.