Skip to content

Instantly share code, notes, and snippets.

View smhutch's full-sized avatar

Scott Hutcheson smhutch

View GitHub Profile
@smhutch
smhutch / personal-raf-boilerplate.js
Created September 2, 2017 17:32 — forked from bendc/personal-raf-boilerplate.js
requestAnimationFrame boilerplate code
"use strict";
// animation utils
// ===============
const trackTime = timing => {
const now = performance.now();
if (!timing.startTime) timing.startTime = now;
const elapsed = now - timing.startTime;