// Create an animation callback every second:
const stopInterval = animationInterval(1000, function (time) {
console.count('Timer')
})
// And to stop it:
stopInterval()
Source: https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95