<p>Is it ever OK to use <code>Environment.TickCount</code>to calculate time spans?</p>

<pre><code>int start = Environment.TickCount;
// Do stuff
int duration = Environment.TickCount - start;
Console.WriteLine("That took " + duration " ms");
</code></pre>

<p>Because <code>TickCount</code> is signed and will rollover after 25 days (it takes 50 days to hit all 32 bits, but you have to scrap the signed bit if you want to make any sense of the math), it seems like it's too risky to be useful. </p>

<p>I'm using <code>DateTime.Now</code> instead. Is this the best way to do this?</p>

<pre><code>DateTime start = DateTime.Now;
// Do stuff
TimeSpan duration = DateTime.Now - start;
Console.WriteLine("That took " + duration.TotalMilliseconds + " ms");
</code></pre>

Use Stopwatch class. There is a decent example on msdn:
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx
```
```
Stopwatch stopWatch = Stopwatch.StartNew();
    Thread.Sleep(10000);
    stopWatch.Stop();
    // Get the elapsed time as a TimeSpan value.
    TimeSpan ts = stopWatch.Elapsed;
```
```