title: A simple 30fps game loop in javascript using requestAnimationFrame?
body: <p>I am writing a card game so i need to setup a basic game loop using window.requestAnimationFrame. I need to make the fps set to 30fps and since it is a slow paced card game i just need a simple workable game loop. My game loop is as follows. </p>
  
  <pre><code>function loop(timestamp) {
            var progress = timestamp - lastRender
  
            update(progress)
            draw()
  
            lastRender = timestamp
            window.requestAnimationFrame(loop)
          }
          var lastRender = 0
          window.requestAnimationFrame(loop)
  </code></pre>
  
  <p>How can i make it so that the fps is set to 30fps? I appreciate any help! Thanks!</p>