Advertisement
d_brezoev

Time

Feb 10th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System.Linq;
  2. using System.Text;
  3. using System.Threading.Tasks;
  4. using System.Diagnostics;
  5. using System.Threading;
  6. namespace Timer
  7. {
  8.     public class Timer
  9.     {        
  10.         private const int time = 400;
  11.         public static Action<string> delegat = Console.WriteLine;
  12.         public static void PrintMessage(string msg, int time)
  13.         {
  14.             while (true)
  15.             {
  16.                 Timer.delegat(msg);
  17.                 Thread.Sleep(time);
  18.             }
  19.            
  20.         }
  21.        
  22.         static void Main(string[] args)
  23.         {
  24.             PrintMessage("Hello", time);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement