title: iOS 9 setTimeout() issues
body: <p>I want to act the distance traveled by a user with JS. The following works on chrome in mobile mode, but when I switch over to iOS, nothing works. I did a bit of digging and found there was something special about setTimeout() on mobile, although the given solution did not work. If I remove the setTimeout(), everything works on iOS, but it fires too fast for it to register good movement.</p>
  
  <pre><code>window.addEventListener('load', function(){
  
  
  var box1 = document.getElementById('box1');
  var statusdiv = document.getElementById('statusdiv');
  var startx = 0;
  var starty = 0;
  var dist = 0;
  
  box1.addEventListener('touchstart', function(e){ e.preventDefault(); });
  
  box1.addEventListener('touchmove', function(e){
  
      var touchobj = e.changedTouches[0];
  
      startx = parseInt(touchobj.clientX);
      starty = parseInt(touchobj.clientY);
  
      setTimeout(function(){
  
          var dist = Math.sqrt(Math.pow(parseInt(touchobj.clientX) - startx,2) + Math.pow(parseInt(touchobj.clientY) - starty,2));
          var angleDeg = 180 - Math.atan2((parseInt(touchobj.clientY) - starty) , (parseInt(touchobj.clientX) - startx)) * (180 / Math.PI);
          statusdiv.innerHTML = 'Status: touchmove&lt;br&gt; Horizontal distance traveled: ' + dist + 'px';
  
      } , 50);
  
      e.preventDefault();
  
  }, false)
  
  
  }, false)
  </code></pre>