private static System.Timers.Timer aTimer;
public static void Main()
Console.WriteLine("\nPress the Enter key to exit the application...\n");
Console.WriteLine("The application started at {0:HH:mm:ss.fff}", DateTime.Now);
Console.WriteLine("Terminating the application...");
private static void SetTimer()
aTimer = new System.Timers.Timer(2000);
aTimer.Elapsed += OnTimedEvent;
private static void OnTimedEvent(Object source, ElapsedEventArgs e)
Console.WriteLine("The Elapsed event was raised at {0:HH:mm:ss.fff}",