title: Swift `Timer` firing before the specified time interval
body: <p>I got a doubt about how <code>Timer.scheduledTimer()</code> fires the block of code if the execution takes more time than the specified <code>withTimeInterval:</code>.</p>
  
  <p>Does the countdown to firing starts after the execution of the block or when the first statement of the block is executed?</p>
  
  <p><strong>So I tested with the following code</strong>:</p>
  
  <pre><code>//Logic is to waste the time in the block which will take more than 5 secs to run.
  Timer.scheduledTimer(withTimeInterval: 5, repeats: true){
      timer in
      var sum = 0
      var count = 0
  
      print("START===================================")
      print(Int64(Date().timeIntervalSince1970 * 1000))
      for i in 2..&lt;100000
      {
          for j in 2..&lt;10000
          {
              sum = i+j
          }
      }
  
      print(sum) // Ignore this. sum is used here so that compiler might won't be able to remove the loop in the optimisations due to unused variable reason.
      print(Int64(Date().timeIntervalSince1970 * 1000))
      print("END===================================")
  }
  
  RunLoop.main.run()
  </code></pre>
  
  <p><strong>Output</strong>:</p>
  
  <pre><code>START===================================
  1507965166992
  109998
  1507965173888
  END===================================
  START===================================
  1507965176993
  109998
  1507965183890
  END===================================
  START===================================
  1507965186989
  </code></pre>
  
  <p>When I subtracted end-time of previous loop and start-time of current loop, I always get around 3 secs. But I have specified 5 secs. Why is that?</p>