MCPcopy Create free account
hub / github.com/apache/echarts / flushTimeoutHandlers

Function flushTimeoutHandlers

test/runTest/runtime/timeline.js:97–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95}
96
97function flushTimeoutHandlers() {
98 // Copy the array. In case setTimeout/clearTimeout is invoked in the callback.
99 const savedTimeoutHandlers = timeoutHandlers.slice();
100 for (let i = 0; i < savedTimeoutHandlers.length; i++) {
101 const handler = savedTimeoutHandlers[i];
102 if (handler.frame === frameIdx) {
103 // Need find index again. In case setTimeout/clearTimeout is invoked in the callback.
104 const idx = timeoutHandlers.indexOf(handler);
105 timeoutHandlers.splice(idx, 1);
106 try {
107 handler.callback();
108 }
109 catch (e) {
110 // Catch error to avoid following tasks.
111 __VRT_LOG_ERRORS__(e.toString());
112 }
113 }
114 }
115}
116
117window.setInterval = function (cb, interval) {
118 const intervalFrame = Math.ceil(Math.max(interval || 0, 1) / FIXED_FRAME_TIME);

Callers 1

runFrameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected