{"ScriptPreparationCode":" function onceIdle1(func = Boolean, group = func) {\r\n window.cancelIdleCallback(group.idleCallback);\r\n group.idleCallback = window.requestIdleCallback(func);\r\n }\r\n\r\n function onceIdle2(func = Boolean, group = func) {\r\n if (!group.idleCallback) {\r\n group.idleCallback = window.requestIdleCallback(() =\u003E {\r\n group.idleCallback = false;\r\n func();\r\n });\r\n }\r\n }\r\n\r\n function noop() {\r\n console.log(new Date().toISOString());\r\n }","TestCases":[{"Name":"CancelCallback","Code":"for(i = 0; i \u003C 1000; i\u002B\u002B) {onceIdle1(noop);}","IsDeferred":false},{"Name":"IfNotCallback","Code":"for(j = 0; j \u003C 1000; j\u002B\u002B) {onceIdle2(noop);}","IsDeferred":false}]}