title: Repeat two tasks every 0.1 ms and 0.3 ms (Systems.Timer.Timer not precise enough)
body: <ol>
  <li><p>Is there a way to execute a method in high resolution frequency in C#, e.g. every 100 microseconds?</p></li>
  <li><p>What about two different methods at different frequencies, e.g. Method1 every 0.1 ms and Method2 0.3 ms?</p></li>
  </ol>
  
  <p>MSDN has documentation on attaching an event handler to the <code>Systems.Timers.Timer</code> class like this:</p>
  
  <pre><code>public static void Main()
  {
  
      System.Timers.Timer aTimer = new System.Timers.Timer();
      aTimer.Elapsed += new ElapsedEventHandler(Method);
      aTimer.Interval = 2000;
      aTimer.Enabled = true;
      GC.KeepAlive(aTimer);
  }
  </code></pre>
  
  <p>But <code>System.Timers.Timer</code> only has a 15~16 ms precision when I benchmarked it. My CPU's performance counter has 0.1 ms precision and below, but I cannot find a way to attach an event handler to the <code>Stopwatch</code> class.</p>
  
  <p>Also, is there some threading issue that I need to be aware of when I am executing the two methods at different frequencies?</p>
  
  <p>Thanks!</p>