Make animated numbers go faster

I’m trying to have the animated numbers move even faster than the time i have inserted, which is 1ms, but it’s not going any faster. Can anyone help?

let startNum = 0;
let endNum = 1100;
const duration = 1;
$w.onReady(function () {
setInterval(() => {
countUp();
}, duration);
});
function countUp() {
if (startNum <= endNum) {
$w('#text26').text = startNum.toString();
startNum++;
startNum = Math.abs(startNum*1)
}
}

Hello.

The minimum setInterval() duration in JavaScript is 4 ms. Although the minimum value you can set is 1 ms the code is actually executed in 4 ms since this is subject to a timer is subject to an algorithm specified is the HTML5 spec. You can click on the link to learn more.

Regards!

You can try counting by 2 or 3 so it appears to go faster. You can even randomly change the increment to a number between (for example) 1 to 5. Then each time it counts it will add a random number within that range.