title: using delta time with javascript
body: <p>i have been seeing a few answers relating to delta time in javascript
  eg; <a href="https://stackoverflow.com/questions/31998251/javascript-gameloop-using-delta-time">this</a> or <a href="https://stackoverflow.com/questions/13996267/loop-forever-and-provide-delta-time/14006703">this</a> but i do not understand how they work, or more rather how i would use them.</p>
  
  <p>currently i just have a main loop that follows this structure</p>
  
  <pre><code>var main = function ()
  {
      doStuff();
      setTimeout(main,1)
  }
  main()
  </code></pre>
  
  <p>but i have found an issue which causes frame drops and thus i now need to use delta time.</p>
  
  <p>how would i edit my main loop to include delta time?</p>