How much time does CPU spend in each method?

  • Thread starter Thread starter Vincent Vega
  • Start date Start date
V

Vincent Vega

Hi,

I'd like to run my WinForms application through a series of tests and
determine where I can optimize my code. Is there an easy way for a brother
to tell which methods were called most frequently, or more importantly,
which methods took the largest fraction of CPU time to execute? This might
help me narrow down my focus a bit.

The only thing I can come up with is to use the DateTime class to
measure the number of "ticks" spent in each method -- but applying this
approach across hundreds of methods is insane. It occurs to me that perhaps
Visual Studio has an automated way of doing this. Any ideas?

You're the man,

Vincent
 
Back
Top