Results Discrepancy

I just finished profiling a Windows Forms application I'm working on, and one of the methods is listed as taking over 800 seconds to run. I added a little code where that call occurs to use the Stopwatch class, and it says it took 172 milliseconds.

Why is there such a huge difference?

Thanks,
Jason

Comments

  • I thought I'd try another Windows Forms application, and sure enough, same thing. My Stopwatch code reports 183ms, while ANTS reports 21+ seconds.

    Something is most certainly wrong here.

    Could it be the hardware? I never had problems like this on my T42 Thinkpad. I've got a Dell Latitude D820 now. I'm wondering if that Core Duo is messing things up. <shrug>

    Jason
  • Hi Jason,

    This method wouldn't happen to be the main form method, would it?
    Application.Run&#40;new Form1&#41;
    
    for instance? With ANTS Profiler, this always ends up reflecting the time of the whole profiling session. This is becasue ANTS Profiler measures real time, and therefore the entire time that the form was open.
  • No, we're not using Application.Run in either of the applications I used to test this.
  • Hi Jason,

    I'm not familiar with stopwatch... is this measuring CPU time or user (real or wall-clock) time?
Sign In or Register to comment.