      frameCount++;
      if (lastTime + 1000.0 <= time) {
        fps.textContent = frameCount;
        lastTime = time;
        frameCount = 0;
      }
    }

    requestAnimationFrame(function loop(now) {
      updateFPS(now);
      requestAnimationFrame(loop);
    })

  </script>
</body>

</html>
