I try this:
Stopwatch timer = new Stopwatch();
timer.Start();
for (i = 0; i < 100; i++) {
//do here some stuff
Thread.Sleep(500);
}
timer.Stop();
TimeSpan ts = timer.Elapsed;
Console.WriteLine(ts.Milliseconds);
And it show me 49 milliseconds, but in fact it was performed in like 2 minutes. It's educational tusk and i have to consider sleep time. How can i do this?