using System.Diagnostics;
public static class Program
public static void Main()
var stopwatch = Stopwatch.StartNew();
using (new Timer(_ => Thread.Sleep(1000), null, 0, Timeout.Infinite))
Console.WriteLine($"Duration: {stopwatch.ElapsedMilliseconds:#,0} msec");