xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

js idle All In One

js idle All In One

idle meaning in js

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/idle

cancelIdleCallback


// var handle = window.requestIdleCallback(callback[, options])
const handle = window.requestIdleCallback(
    (IdleDeadline) => console.log(`handle =`, window.handle, IdleDeadline),
    {
         timeout: 1000,// mm
    }
);

// handle = 13 IdleDeadline {didTimeout: false}

// didTimeout: false__proto__: IdleDeadlinedidTimeout: (...)timeRemaining: ƒ timeRemaining()constructor: ƒ IdleDeadline()Symbol(Symbol.toStringTag): "IdleDeadline"get didTimeout: ƒ didTimeout()__proto__: Objectconstructor: ƒ Object()hasOwnProperty: ƒ hasOwnProperty()isPrototypeOf: ƒ isPrototypeOf()propertyIsEnumerable: ƒ propertyIsEnumerable()toLocaleString: ƒ toLocaleString()toString: ƒ toString()valueOf: ƒ valueOf()__defineGetter__: ƒ __defineGetter__()__defineSetter__: ƒ __defineSetter__()__lookupGetter__: ƒ __lookupGetter__()__lookupSetter__: ƒ __lookupSetter__()get __proto__: ƒ __proto__()set __proto__: ƒ __proto__()

window.cancelIdleCallback(handle);


https://developers.google.com/web/updates/2015/08/using-requestidlecallback

https://stackoverflow.com/questions/20702940/what-does-idle-mean-in-google-chrome-devtools-profiler

https://dev.to/canastro/javascript-long-running-tasks-use-cpu-s-idle-periods-58g2

Window.requestIdleCallback

https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback

// var handle = window.requestIdleCallback(callback[, options])
var handle = window.requestIdleCallback(
    () => console.log(`handle =`, window.handle),
    {
        timeout: 1000,// mm
    }
);

// handle = 1

window.cancelIdleCallback(handle);

https://developer.mozilla.org/zh-CN/docs/Web/API/Window/cancelIdleCallback

https://caniuse.com/#search=requestIdle

https://humanwhocodes.com/blog/2009/06/02/detecting-if-the-user-is-idle-with-javascript-and-yui-3/

https://github.com/pixijs/pixi.js/issues/3146

https://github.com/googleapis/cloud-profiler-nodejs/issues/38

An UMD lib to know when a page goes idle: hidden, or inactive.

https://www.npmjs.com/package/idle-js

idle & Dart & Flutter

image

https://dart-lang.github.io/observatory/

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!




©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2019-08-30 09:25  xgqfrms  阅读(238)  评论(6)    收藏  举报