MCPcopy Create free account
hub / github.com/microsoft/SandDance / nap

Function nap

docs/app/js/sanddance-app.js:136689–136700  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136687 if (delay > pokeDelay) clockSkew -= delay, clockLast = now1;
136688}
136689function nap() {
136690 var t0, t1 = taskHead, t2, time = Infinity;
136691 while(t1)if (t1._call) {
136692 if (time > t1._time) time = t1._time;
136693 t0 = t1, t1 = t1._next;
136694 } else {
136695 t2 = t1._next, t1._next = null;
136696 t1 = t0 ? t0._next = t2 : taskHead = t2;
136697 }
136698 taskTail = t0;
136699 sleep(time);
136700}
136701function sleep(time) {
136702 if (frame) return; // Soonest alarm already set, or will be.
136703 if (timeout) timeout = clearTimeout(timeout);

Callers 1

wakeFunction · 0.70

Calls 1

sleepFunction · 0.70

Tested by

no test coverage detected