Newer
Older
CVSS_3.0_GUI / node_modules / nwjs-builder-phoenix / node_modules / request-progress / node_modules / throttleit / example.js
root on 7 May 2019 221 bytes Initial commit
  1.  
  2. var throttle = require('./');
  3.  
  4. function onprogress(n) {
  5. console.log('progress %s%', n);
  6. }
  7.  
  8. onprogress = throttle(onprogress, 500);
  9.  
  10. var n = 0;
  11. setInterval(function(){
  12. if (n >= 100) return;
  13. onprogress(n++);
  14. }, 50);
Buy Me A Coffee