1 Star 0 Fork 0

白一梓 / async-tutorial-code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
demo_workers.js 288 Bytes
一键复制 编辑 原始数据 按行查看 历史
白一梓 提交于 2015-05-14 17:39 . 增加对于node0.12.x的扩展支持
onmessage = function(event) {
var index = event.data;
console.log('worker '+index);
var i=0;
var data = {workerIndex:index,i:i};
function timedCount()
{
i=i+1;
data.i = i;
postMessage(JSON.stringify(data));
setTimeout(function() {timedCount()},500);
}
timedCount();
}
JavaScript
1
https://gitee.com/yunnysunny/async-tutorial-code.git
git@gitee.com:yunnysunny/async-tutorial-code.git
yunnysunny
async-tutorial-code
async-tutorial-code
master

搜索帮助