title: Animation, FPS, and KineticJS
body: <p>So I have a little game of a ball moving around on the screen and I would like to calculate the FPS. I am using KineticJS (4.3.1) which utilizes requestAnimationFrame under the hood.</p>
  
  <pre><code>      var anim = new Kinetic.Animation(
            function(frame) {
  
              //game logic
                 //move ball
                 //check collisions - if collision occurs, stop animation
                 //redraw 
  
            }
        }
  </code></pre>
  
  <p>The 'frame' object has a time property which can be accessed with frame.time which measures the time since the animation was first started in milliseconds.</p>
  
  <pre><code>     var timeSinceAnimationStarted = frame.time;
  </code></pre>
  
  <p>What would be an accurate way of measuring the FPS?</p>