use calculated time offset to fix issue when requestAnimationFrame isn't executed regularly