title: Thread or Timer , The best way for running every x minute
body: <p>I Have at least 20 threads that each does some operations every x minutes. My issue here is that I can use timers with interval, which I register a delegate on their ElapsedEventHandler and in that method I do my operation with Thread or Task . BTW I can manage timer's start, stop and interval easily</p>
  
  <p>Is this the best way ? 
  Is there any other solution or other choices in .NET?</p>
  
  <p>for example : </p>
  
  <pre><code>List&lt;IpeTimer&gt; Timers = new List&lt;IpeTimer&gt;();
  
          Timers.Add(new IpeTimer(){ TimerName = "timer1" ,Timer = new System.Timers.Timer()});
          Timers[0].Timer.Interval = 4000;
          Timers[0].Timer.Elapsed += new ElapsedEventHandler(TimerEventProcessor1);
          Timers[0].Timer.Start();
  
  
          Timers.Add(new IpeTimer() { TimerName = "timer2", Timer = new System.Timers.Timer() });
          Timers[1].Timer.Interval = 5000;
          Timers[1].Timer.Elapsed += new ElapsedEventHandler(TimerEventProcessor2);
          Timers[1].Timer.Start();
  </code></pre>
  
  <p>and </p>
  
  <pre><code>public static void TimerEventProcessor1(object sender, ElapsedEventArgs e)
      {
          Task t2 = new Task(() =&gt;
          {
              Console.WriteLine("1");
          }
          , TaskCreationOptions.LongRunning);
          t2.Start();
      }
  
      public static void TimerEventProcessor2(object sender, ElapsedEventArgs e)
      {
          Task t2 = new Task(() =&gt;
          {
              Console.WriteLine("2");
          }
          , TaskCreationOptions.LongRunning);
          t2.Start();
      }
  </code></pre>