3 ms·
It works for any measurement! That choice is left completely up to the user. Instead of wrapping it in an event handler, you might instead set a variable for 's
by christinecha 10y ago
It works for any measurement! That choice is left completely up to the user. Instead of wrapping it in an event handler, you might instead set a variable for 'start time', run animations on requestAnimationFrame, and pass in the current time.