A small and portable timing events helper, compatible with document (requestAnimationFrame) and workers environments.