SOURCE

async function timeout(ms) {
  await new Promise((resolve, reject) => {
    setTimeout(resolve, ms);
  });
}


async function asyncPrint(str,ms) {
  await timeout(ms);
  document.querySelector('body').innerText = str;
}

asyncPrint('done!', 2000);
console 命令行工具 X clear

                    
>
console