Based on this answer: https://stackoverflow.com/a/15693230/3633935 I wanted to create the same animation for time countdown. Drawing it in 1 second interval is fine, also 100ms seems to be correct, but that doesn't look smooth. And to make it look smoother I should decrease the time interval, but by doing this, something goes wrong, maybe the canvas animation doesn't catch up, or the code could be improved. Im open to any ideas. To illustrate the problem I modified the fiddle provided in the original answer. http://jsfiddle.net/uhVj6/1808/ Change the
curTime += 1000;
setTimeout(function () {
animate(curPerc / 100)
}, 1000);
to
curTime += 10;
setTimeout(function () {
animate(curPerc / 100)
}, 10);
to see the problem.