📜  Javascript 事件循环 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:42.679000             🧑  作者: Mango

代码示例2
function task(message) {
    // emulate time consuming task
    let n = 10000000000;
    while (n > 0){
        n--;
    }
    console.log(message);
}

console.log('Start script...');
task('Download a file.');
console.log('Done!');
Code language: JavaScript (javascript)