MCPcopy Create free account
hub / github.com/breck7/scroll / nap

Function nap

external/.d3.js:4114–4127  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4112}
4113
4114function nap() {
4115 var t0, t1 = taskHead, t2, time = Infinity;
4116 while (t1) {
4117 if (t1._call) {
4118 if (time > t1._time) time = t1._time;
4119 t0 = t1, t1 = t1._next;
4120 } else {
4121 t2 = t1._next, t1._next = null;
4122 t1 = t0 ? t0._next = t2 : taskHead = t2;
4123 }
4124 }
4125 taskTail = t0;
4126 sleep(time);
4127}
4128
4129function sleep(time) {
4130 if (frame) return; // Soonest alarm already set, or will be.

Callers 1

wakeFunction · 0.85

Calls 1

sleepFunction · 0.85

Tested by

no test coverage detected