audreyt / node-webworker-threads

Lightweight Web Worker API implementation with native threads
https://npmjs.org/package/webworker-threads
Other
2.3k stars 149 forks source link

Add setImmediate, setTimeout and other Timer functions #176

Open LostAbaddon opened 6 years ago

LostAbaddon commented 6 years ago

Change log:

  1. Change the console output format;
  2. Set the behaviour of nextTick just like what the node.js do;
  3. Add setImmediate function and it functions just like what in node.js;
  4. Add setTimeout, clearTimeout, setInterval, clearInterval functions and they function just like what in node.js.

Problem remains: The new functions will be called each while loop, so the CPU usage will be high.