title: Timer in Asp.Net Web API
body: <p>I want use one Timer in my controller to do a specific job.</p>
  
  <p>Below is the code</p>
  
  <pre><code>    public class ProductsController : ApiController
      {
  
          private readonly System.Timers.Timer _checkTimer = new System.Timers.Timer();
          public readonly int CheckTimerInterval = 10 * 30 * 1000;
  
          public ProductsController()
          {
              _checkTimer.Elapsed += CheckTimerElapsed;
              _checkTimer.Interval = this.CheckTimerInterval;
              _checkTimer.Enabled = true;
          }
  
          private void CheckTimerElapsed(object source, ElapsedEventArgs e)
          { 
            //Do the processing
          }
       }
  </code></pre>
  
  <p>But the problem is when ever I call controller a new instance of Timer is created.</p>
  
  <p>I want only one timer instance.Can you please help me to achieve this?</p>
  
  <p>I know using Timer in controller is not a good idea but I do not have other option.I use this controller to assign Requests to an temporary User.In Timer I need to get all jobs and assign it to actual User.</p>