using System.Diagnostics;
public static class Program
public static void Main()
if (Stopwatch.IsHighResolution)
Console.WriteLine("Operations timed using the system's high-resolution performance counter.");
Console.WriteLine("Operations timed using the DateTime class.");
long frequency = Stopwatch.Frequency;
Console.WriteLine(" Timer frequency in ticks per second = {0}",
long nanosecPerTick = (1000L*1000L*1000L) / frequency;
Console.WriteLine(" Timer is accurate within {0} nanoseconds",