async function asyncLoop(iters, tick, cb) {
        let ts = Date.now();
        for (let i = 0; i < iters; i++) {
          cb(i);
          // Date.now() is not monotonic, so in case if clock goes backwards we return return control too
          const diff = Date.now() - ts;
          if (diff >= 0 && diff < tick) continue;
          await (0, exports.nextTick)();
          ts += diff;
        }
      }
// Returns control to thread each 'tick' ms to avoid blocking
Returns control to thread each 'tick' ms to avoid blocking
Returns control to thread each ' tick ' ms to avoid blocking
async function asyncLoop(iters, tick, cb) {
        let ts = Date.now();
        for (let i = 0; i < iters; i++) {
          cb(i);
          const diff = Date.now() - ts;
          if (diff >= 0 && diff < tick) continue;
          await (0, exports.nextTick)();
          ts += diff;
        }
      }
async function asyncLoop ( iters , tick , cb ) { let ts = Date . now ( ) ; for ( let i = 0 ; i < iters ; i ++ ) { cb ( i ) ; const diff = Date . now ( ) - ts ; if ( diff >= 0 && diff < tick ) continue ; await ( 0 , exports . nextTick ) ( ) ; ts += diff ; } }
Returns control to thread each 'tick' ms to avoid blocking
Returns control to thread each ' tick ' ms to avoid blocking
// Date.now() is not monotonic, so in case if clock goes backwards we return return control too