Skip to content

ck-tan/fps-counter-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fps-counter-js

  • A JavaScript FPS counter implementation.
  • A fixed position FPS counter will appear on the top left of the screen on initiation
  • Edit the CSS style within the source to change the position

Instructions

Open index.html in a web browser to test. Include the script

<script type="text/javascript" src="scripts/fps-counter.js"></script>

Initiate by creating a new instance of fpsCounter()

var myFPSCounter = new fpsCounter();

Update the object every tick or frame by calling the update() function

myFPSCounter.update(timestamp);

Passing a timestamp (e.g. from requestAnimationFrame) is optional. If there are no arguments, it will default to using performance.now()

About

A JavaScript FPS counter implementation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published