JavaScript 模拟后台任务
2024-10-07 15:18:21
读书笔记,请勿转载,发布,产权不归我所有,归以前作者所有,我只是做读书笔记。 /*!
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/ /*
* @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback
*/
window.requestIdleCallback = window.requestIdleCallback ||
function (cb) {
var start = Date.now();
return setTimeout(function () {
cb({
didTimeout: false,
timeRemaining: function () {
return Math.max(0, 50 - (Date.now() - start));
}
});
}, 1);
} window.cancelIdleCallback = window.cancelIdleCallback ||
function (id) {
clearTimeout(id);
}
最新文章
- HTML5学习总结——canvas绘制象棋(canvas绘图)
- TCP连接的建立和终止
- JAVA-多屏幕显示
- 实现 DIV 固定定位在网页主体部分最右侧
- Windows Server 2012学习文档
- CSS font-family的順序
- Java---IO加强(3)-IO流的操作规律
- android merge 标签的使用
- FastJSON应用前测试
- 5.单行函数,多行函数,字符函数,数字函数,日期函数,数据类型转换,数字和字符串转换,通用函数(case和decode)
- OMR数据查询
- MVC02
- MySQL插入10万数据时间(结论:最快14.967s,每秒插入6681条)
- G1 垃圾收集器入门
- 制作OTA升级包
- LDAP2-创建OU创建用户
- 使用css控制文字显示几行并且剩余部分隐藏(移动端和PC端同样适用)
- 跟随我在oracle学习php(4)
- 四种常见的 POST 提交数据方式(application/x-www-form-urlencoded,multipart/form-data,application/json,text/xml)
- mongoDB 的介绍