Write a C# Program to Create a Stop Watch

using System;

using System.Collections.Generic;

using System.Diagnostics;

using System.Linq;

using System.Text;

using System.Threading.Tasks;


namespace ConsoleApplication

{                                  

    class Program

    {

        static void Main(string[] args)

        {

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            for (int i = 0; i < 5; i++)

            {

                Console.WriteLine("Coding");

            }

            stopwatch.Stop();

            Console.WriteLine("Time Taken : "+stopwatch.Elapsed);

            Console.ReadKey();

        }

    }

}


Output:-

Coding

Coding

Coding

Coding

Coding

Time Taken : 00:00:00.0006300


एक टिप्पणी भेजें

0 टिप्पणियाँ