title: Using Timer to delay an operation a few seconds
body: <p>I am trying to delay my method by using a timer:</p>
  
  <pre><code>private System.Timers.Timer _delayTimer;
  
      private void delay()
      {
            _delayTimer = new System.Timers.Timer();
            _delayTimer.Interval = 5000;
            //_delayTimer.Enabled = true;
            _delayTimer.Elapsed += _delayTimer_Elapsed;
            _delayTimer.Start();
            someMethod();
          }
      }
  
      private void _delayTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
      {
          // delay for 5 seconds
      }
  </code></pre>
  
  <p>When i am get into <code>delay()</code> method i want to start the timer, than i want the 5 seconds delay and only after that i want to execute <code>someMethod()</code> and currently this not happen, after execute <code>delay()</code> the <code>someMethod()</code> executed without 5 seconds delay</p>