Sam Beauvois: general dev, .net and other stuff

How long need a portion of code to be executed ?

Use the Stopwatch object !

using System.Diagnostics;

// ...

Stopwatch myStopWatch = Stopwatch.StartNew();

// some code

myStopWatch.Stop();

Console.WriteLine("{0} ms - {1} ticks", myStopWatch.Elapsed.TotalMilliseconds, myStopWatch.ElapsedTicks);

// ...
  • Amiable fill someone in on and this post helped me alot in my college assignement. Say thank you you as your information.

You can follow any responses to this entry through the RSS 2.0 feed.