 <p>Try using</p> <pre><code>Stopwatch stpWatch1 = new Stopwatch(); stpWatch1.Start(); ............. stpWatch1.Stop(); TimeSpan ts = stpWatch1.Elapsed;// it also contains stpWatch1.ElapsedMilliseconds </code></pre>