Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 3 gadiem
12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Overview
  2. Adds support for the `timers` module to browserify.
  3. ## Wait, isn't it already supported in the browser?
  4. The public methods of the `timers` module are:
  5. * `setTimeout(callback, delay, [arg], [...])`
  6. * `clearTimeout(timeoutId)`
  7. * `setInterval(callback, delay, [arg], [...])`
  8. * `clearInterval(intervalId)`
  9. and indeed, browsers support these already.
  10. ## So, why does this exist?
  11. The `timers` module also includes some private methods used in other built-in
  12. Node.js modules:
  13. * `enroll(item, delay)`
  14. * `unenroll(item)`
  15. * `active(item)`
  16. These are used to efficiently support a large quantity of timers with the same
  17. timeouts by creating only a few timers under the covers.
  18. Node.js also offers the `immediate` APIs, which aren't yet available cross-browser, so we polyfill those:
  19. * `setImmediate(callback, [arg], [...])`
  20. * `clearImmediate(immediateId)`
  21. ## I need lots of timers and want to use linked list timers as Node.js does.
  22. Linked lists are efficient when you have thousands (millions?) of timers with the same delay.
  23. Take a look at [timers-browserify-full](https://www.npmjs.com/package/timers-browserify-full) in this case.
  24. # License
  25. [MIT](http://jryans.mit-license.org/)