MCPcopy Create free account
hub / github.com/Code-Bullet/Jump-King / drainQueue

Function drainQueue

libraries/p5.js:7433–7455  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7431}
7432
7433function drainQueue() {
7434 if (draining) {
7435 return;
7436 }
7437 var timeout = runTimeout(cleanUpNextTick);
7438 draining = true;
7439
7440 var len = queue.length;
7441 while(len) {
7442 currentQueue = queue;
7443 queue = [];
7444 while (++queueIndex < len) {
7445 if (currentQueue) {
7446 currentQueue[queueIndex].run();
7447 }
7448 }
7449 queueIndex = -1;
7450 len = queue.length;
7451 }
7452 currentQueue = null;
7453 draining = false;
7454 runClearTimeout(timeout);
7455}
7456
7457process.nextTick = function (fun) {
7458 var args = new Array(arguments.length - 1);

Callers 1

cleanUpNextTickFunction · 0.85

Calls 2

runTimeoutFunction · 0.85
runClearTimeoutFunction · 0.85

Tested by

no test coverage detected