Stopwatch class for calculating the running time

Stopwatch class

Namespace: System.Diagnostics.Stopwatch

Examples of: Stopwatch getTime = new Stopwatch ();

Start time: getTime.Start ();

              getTime.Stop();

              Console.WriteLine("getTime:"+totleTime .ElapsedMilliseconds.ToString ());

Common attributes: Stopwatch.Elapsed Get total run time of the current instance of the derived measurements.

               Stopwatch.ElapsedMilliseconds Get Current Total run time (in milliseconds time) Examples of measurements obtained.

               Total run time Stopwatch.ElapsedTicks obtain measurement results of the current instance (represented by a timer ticks).

     Stopwatch.IsRunning Gets a value indicating whether the timer is running Stopwatch

Guess you like

Origin www.cnblogs.com/zhou0818/p/11207724.html