The below program will do so
using System;
using System.Diagnostics;
using System.Linq;
namespace TodayTask
{
class Program
{
static void Main(string[] args)
{
var stopWatch = new Stopwatch();
//start measuring the initial time of the program
stopWatch.Start();
//do some heavy work
Enumerable
.Range(1, 200000)
.ToList()
.ForEach(i => Console.WriteLine(i));
//finally stop the watch
stopWatch.Stop();
//measure the total executuion time
Console.WriteLine(stopWatch.ElapsedTicks);
Console.ReadLine();
}
}
}