Example of c imer

From , 2 Years ago, written in C#, viewed 178 times.
URL https://pastebin.vip/view/40cccad2
  1. using System;
  2. using System.Timers;
  3. class TestTimer
  4. {
  5.     public static void Main()
  6.     {
  7.         Timer timer = new Timer();
  8.         timer.Elapsed += new ElapsedEventHandler( DisplayTimeEvent );
  9.         timer.Interval = 1000;
  10.         timer.Start();
  11.         timer.Enabled = true;
  12.         while ( Console.Read() != 'q' )
  13.         {
  14.             //-------------
  15.         }
  16.     }
  17.     public static void DisplayTimeEvent( object source, ElapsedEventArgs e )
  18.     {
  19.         Console.Write(\r{0}, DateTime.Now);
  20.     }
  21. }
  22. //csharp/4115

Reply to "Example of c imer"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website