📜  setimmediate 与 settimeout - Javascript 代码示例

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

代码示例1
// only on node.js! timeout vs immediate.js 
setTimeout(() => {
  console.log('timeout');
}, 0);

setImmediate(() => {
  console.log('immediate');
});