【发布时间】:2022-08-19 00:06:31
【问题描述】:
process.on(\'beforeExit\', (code) => {
setTimeout(() => {
console.log(\'This will make strange behaviour\');
});
});
标签: javascript node.js callback backend event-loop
process.on(\'beforeExit\', (code) => {
setTimeout(() => {
console.log(\'This will make strange behaviour\');
});
});
标签: javascript node.js callback backend event-loop
尝试这个:
process.on('beforeExit', (code) => {
setTimeout(() => {
console.log('This will make strange behaviour');
}, 3000);
});
【讨论】: