scheduling
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -1,1 +0,1 @@ | ||
let n=window,e=60,r=performance.now(),t=0,o=0,f=r;const u=[],c=[],a=[],i=[];let s=[],l=[],g=0;!function g(){!function(){let n,g=0,m=1e3/e,p=0;for(g=0;g<u.length;g++)n=u[g],null!=n&&n.func(n.args);for(;s.length>0;)n=s.pop(),n.func(n.args);let h=performance.now();for(o=(h-r)/1e3,t=h-f,g=0;g<c.length;g++)n=c[g],h-n.time>n.delay&&(n.func(n.args),c.splice(g,1));for(h=performance.now();a.length>0;){if(n=a.shift(),p=performance.now(),!(p-h<m)){a.unshift(n);break}n.func(n.args)}for(h=performance.now();i.length>0;)n=i.shift(),p=performance.now(),p-h<m&&n.func(n.args);f=h,s=s.concat(l),l=[]}(),n.requestAnimationFrame(g)}();var m={addEF:function(n,e){const r=++g;return u[r]={func:n,args:e},r},removeEF:function(n){return void 0!==u[n]&&(u[n]=null),-1},delay:function(n,e,r){const t=performance.now();c.push({func:n,args:e,delay:r,time:t})},next:function(n,e){l.push({func:n,args:e})},defer:function(n,e){a.push({func:n,args:e})},usurp:function(n,e){i.push({func:n,args:e})},setRequestAnimationFrameSource:function(e){n=e},setFrameRate:function(n){e=n},getElapsedTime:function(){return o},getDeltaTime:function(){return t}};export default m; | ||
let n=window,e=60,r=performance.now(),t=0,o=0,f=r;const u=[],c=[],a=[],i=[];let s=[],l=[],g=0;function m(){!function(){let n,g=0,m=1e3/e,p=0;for(g=0;g<u.length;g++)n=u[g],null!=n&&n.func(n.args);for(;s.length>0;)n=s.pop(),n.func(n.args);let h=performance.now();for(o=(h-r)/1e3,t=h-f,g=0;g<c.length;g++)n=c[g],h-n.time>n.delay&&(n.func(n.args),c.splice(g,1));for(h=performance.now();a.length>0;){if(n=a.shift(),p=performance.now(),!(p-h<m)){a.unshift(n);break}n.func(n.args)}for(h=performance.now();i.length>0;)n=i.shift(),p=performance.now(),p-h<m&&n.func(n.args);f=h,s=s.concat(l),l=[]}(),n.requestAnimationFrame(m)}m();var p={addEF:function(n,e){const r=++g;return u[r]={func:n,args:e},r},removeEF:function(n){return void 0!==u[n]&&(u[n]=null),-1},delay:function(n,e,r){const t=performance.now();c.push({func:n,args:e,delay:r,time:t})},next:function(n,e){l.push({func:n,args:e})},defer:function(n,e){a.push({func:n,args:e})},usurp:function(n,e){i.push({func:n,args:e})},setRequestAnimationFrameSource:function(e){n=e,m()},setFrameRate:function(n){e=n},getElapsedTime:function(){return o},getDeltaTime:function(){return t}};export default p; |
{ | ||
"name": "scheduling", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "A enterframe tool", | ||
@@ -5,0 +5,0 @@ "main": "build/scheduler.js", |
@@ -122,2 +122,3 @@ // animation frame source | ||
afSource = mSource; | ||
loop(); | ||
} | ||
@@ -124,0 +125,0 @@ |
11546
324