Profiling application

A

Andrus

My .NET 2 WinForms application is running a bit slow. I suspect that
database calls will take too much time.

How to find which methods take most of the time?

I'm using Visual C# 2005 Express Edition.

I havent found any way to create list of executed method calls ordered by
execution time.

Andrus
 
G

Guest

One quick and easy way is to use the StopWatch class: Instantiate a new
StopWatch and surround the database call with a pair of StopWatch instance's
Start and Stop methods. After Stop(), use one of StopWatch.Ellapsed* to get
the time spent for the DB call.
 
M

Michael Nemtsev

Hello Andrus,

You can use the performance counters or special profiler tools like http://www.jetbrains.com/profiler/download/index.html

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

A> My .NET 2 WinForms application is running a bit slow. I suspect that
A> database calls will take too much time.
A>
A> How to find which methods take most of the time?
A>
A> I'm using Visual C# 2005 Express Edition.
A>
A> I havent found any way to create list of executed method calls
A> ordered by execution time.
A>
A> Andrus
A>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top