private void btnGetExecutionTime_Click(object sender, EventArgs e)
{
//First Create the instance of Stopwatch Class
Stopwatch sw = new Stopwatch();
// Start The StopWatch ...From 000
sw.Start();
for (int i = 0; i <= 1000; i++)
{
}
//Stop the Timer
sw.Stop();
//Writing Execution Time in label
string ExecutionTimeTaken = string.Format("Minutes :{0}\nSeconds :{1}\n Mili seconds :{2}",sw.Elapsed.Minutes,sw.Elapsed.Seconds,sw.Elapsed.TotalMilliseconds);
label1.Text = ExecutionTimeTaken;
}