Just record the time when the application/method begins execution and diff the time when it stops.
DateTime start = DateTime.Now;
// .. do something
TimeSpan duration = DateTime.Now - start;
Console.WriteLine("Ran for {0} milliseconds.", duration.Milliseconds);
This is basically what Christian's source that someone mentioned is doing. I mean, how else would you do it? If you want a more thorough solution, I recommend a CLR profile like this free one[^] from Microsoft.
Microsoft MVP, Visual C# My Articles