title: .NET scheduler class architecture
body: <p>We are developing a custom scheduler class, that should be able to invoke tasks periodically.</p>
  
  <p>We are thinking of two possible approaches:</p>
  
  <ol>
  <li><p>For each task, that has period of X seconds, create its own timer with interval equal to task's period, or</p></li>
  <li><p>Create one timer, and on each its tick recalculate its interval, iterating all tasks and finding one that is the most close in time?</p></li>
  </ol>
  
  <p>The first approach seems to be more simple and straightforward, but I do not know if creating of 10 or 20 timers is expensive.</p>
  
  <p>How do you think, which one is better from the performance point of view?</p>