Why is the behavior of setTimeout(0) and setImmediate() undefined when used in the main module ?
问题 Take the following code taken from the nodejs event loop documentation : // timeout_vs_immediate.js setTimeout(() => { console.log('timeout'); }, 0); setImmediate(() => { console.log('immediate'); }); According to the documentation : For example, if we run the following script which is not within an I/O cycle (i.e. the main module), the order in which the two timers are executed is non-deterministic, as it is bound by the performance of the process. Why is the above statement true ? Is it