A simple module for measuring time in animations.
npm install delta-timer
Create a new timer. Optionally, you can pass in a custom method for
generating that returns a timestamp - otherwise, this will default to
the best available of
Returns the amount of time since
timer was last called.
Resets the timer - the next return value will be 0.
Disables the timer.
timer() will always return 0 during this time.
Resumes the timer - if previously paused, this will reset it too to avoid skipping forward too far in time.
Returns the current timestamp.
var timer = require'delta-timer'raf = require'raf'var scene = require'./scene'rafwindowon'data'var dt = timerscenetickdt