Use setTimeout instead of setInterval
Reduce the number of DOM updates when creating pagination