Skip to content

speedr/raf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cursor

Helper for requestAnimationFrame

Install

$ npm install --save speedr/raf

Usage

var raf = require('raf');
var id = raf.start(function(elapsed) {
  // Called every frames
  game.update(elapsed);
});

API

raf.start(fn)

Calls fn on every frame with elapsed set to the elapsed time in milliseconds.
Returns the request ID.

raf.stop(id)

Cancels the specified animation frame request.

License

MIT © Florent Cailhol

About

Helper for requestAnimationFrame

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published