title: Two timers running simultaneously and independently
body: <p>First of all, I just wanted to say thanks for all the help given in the past couple weeks. I've learned a ton and my program has been saving me hours and hours of work every day.</p>
  
  <p>I want to expand it a little bit and add a second timer that runs parallel to the first timer, but is not affected in any way shape or form by the first timer.</p>
  
  <p>I've tried nesting the second loop in the first loop but the second loop takes 3 seconds to complete (I use thread.sleep(3000)), so I found that it froze the first loop till the second loop finishes. I was reading about system threading (System.Timers.Timer) and it seems like that is the route I want to go. </p>
  
  <p>I wrote this quick as an example:</p>
  
  <p>This assumes that I added a windows timer control as timer1</p>
  
  <pre><code>Option Strict On
  Imports System
  Imports System.Timers
  
  Public Class form1
  
    Private Shared timer2 As System.Timers.Timer
    timer2 = New System.Timers.Timer
    AddHandler timer2.Elapsed, AddressOf OnTimedEvent
  
    Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
                             Handles Button1.Click
      timer1.Interval = 1000
      timer1.enabled = true
      timer2.Interval = 5000
      timer2.Enabled = True
    End sub
  
    Public Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) _
                           Handles Timer1.Tick
    'code for timer1 here
    End Sub
  
    Private Shared Sub OnTimedEvent(source As Object, e As ElapsedEventArgs)
      'code for timer2 here
    End Sub
  
  End Class 
  </code></pre>
  
  <p>Does this even make sense?... and again I can't use the timer1 to set off the second round of events because of the <code>thread.sleep</code>. I was hoping that the code above puts the second thread to sleep while the <code>windows.form.timer</code> continues on ticking every 1000 ms </p>