title: How to enqueue using 1 Timer and Dequeue with another
body: <p>I need to enqueue items into a Queue at roughly 4 to 8ms intervals.</p>
  
  <p>Separately, my UI layer needs to dequeue, process, and display info from these items at roughly 33ms intervals (it may dequeue multiple times at that interval).</p>
  
  <p>I'm not quite sure what combination of Timers and Queue I should use to get this working.</p>
  
  <p>I think I should user the ConcurrentQueue class for the queue, but what timer mechanism should I use for the Enqueueing and Dequeuing?</p>
  
  <p>UPDATE:
  I ended up going with something like Brian Gideon's and Alberto's answers.</p>
  
  <p>Without going into all the details here is what I did: </p>
  
  <p>I used the following timer to for both my 4ms timer and my 33ms timer. (<a href="http://www.codeproject.com/Articles/98346/Microsecond-and-Millisecond-NET-Timer" rel="nofollow">http://www.codeproject.com/Articles/98346/Microsecond-and-Millisecond-NET-Timer</a>)</p>
  
  <p>My 4ms timer reads data from a high speed camera, does a small amount of processing and enqueues the data into a ConcurrentQueue.</p>
  
  <p>My 33ms timer dequeues all items from the queue, does some more processing on each item and sends the data to another object that computes a rolling average over some given interval.  (Queues are used to manage the rolling averages.)</p>
  
  <p>Within the CompositionTarget.Rendering event, I grab the value(s) from the rolling average object and plot them on my custom line graph control.</p>
  
  <p>I mentioned 33ms for the UI because this data is being fed into a realtime graph.  33ms is about 30 fps... anything slower than that and some smoothness is lost.</p>
  
  <p>I did end up using the ConccuentQueue as well. Works great.</p>
  
  <p>CPU takes a bit of a hit. I think it's due to the high performance timers.</p>
  
  <p>Thanks for the help everyone.</p>