console
setTimeout(()=>{
const total = 100000;
const once = 20;
const loopCount = total / once;
let countOfRender = 0
let ul = document.querySelector('ul');
function add(){
const fragment = document.createDocumentFragment();
for(let i=0;i < once;i++) {
const li = document.createElement('li');
li.innerText = Math.floor(Math.random() * total);
fragment.appendChild(li);
}
ul.appendChild(fragment);
countOfRender += 1;
loop()
}
function loop() {
if(countOfRender < loopCount) {
window.requestAnimationFrame(add);
}
}
loop()
},0)
<ul>
控件
</ul>