using System.Diagnostics;
public static void Main()
Stopwatch timer = Stopwatch.StartNew();
TimeSpan timeSpan = timer.Elapsed;
Console.WriteLine("Total processing time... {0:00}:{1:00}:{2:00}.{3}", timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds, timeSpan.Milliseconds);
DateTime start = DateTime.Now;
Console.WriteLine("Process starting at: " + start.ToString("dd/MM/yyyy hh:mm:ss tt"));
DateTime end = DateTime.Now;
Console.WriteLine("Process finished at: " + end.ToString("dd/MM/yyyy hh:mm:ss tt"));
TimeSpan diff = (end - start);
Console.WriteLine("Total elapsed time: {0:00}:{1:00}:{2:00}.{3}", diff.Hours, diff.Minutes, diff.Seconds, diff.Milliseconds);