Stopwatch function to get executions time in C#

Sourav.Kayal
Posted by Sourav.Kayal under C# category on | Points: 40 | Views : 746
using System;
using System.Linq;
using System.Text;
using System.Collections;
using System.Data;
using System.Xml;
using System.IO;
using System.Diagnostics;

namespace BlogProject
{
class Program
{
static void Main(string[] args)
{
Stopwatch st = new Stopwatch();
st.Start();
for (int i = 0; i < 1000; i++)
{
Console.Write("Hello");
}
st.Stop();
Console.WriteLine(st.ElapsedTicks);
Console.ReadLine();
}
}
}

Comments or Responses

Login to post response