Exemple #1
0
        public void Start()
        {
            while (this.Seconds > 0)
            {
                Thread.Sleep(this.Interval);
                this.Seconds = this.Seconds - 1;

                TimeElapsedEventArgs ev = new TimeElapsedEventArgs(this.Seconds);
                TimeElapsed(this, ev);
            }
        }
Exemple #2
0
 //Message to display
 static void PrintMessage(object publisher, TimeElapsedEventArgs eventArgs)
 {
     Console.Clear();
     Console.WriteLine("{0} seconds", eventArgs.Seconds);
 }