You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
358 B
12 lines
358 B
|
2 years ago
|
var gamma = require('gamma');
|
||
|
|
|
||
|
|
module.exports = function () {
|
||
|
|
self.addEventListener('message',function (ev){
|
||
|
|
var startNum = parseInt(ev.data); // ev.data=4 from main.js
|
||
|
|
|
||
|
|
setInterval(function () {
|
||
|
|
var r = startNum / Math.random() - 1;
|
||
|
|
self.postMessage([ startNum, r, gamma(r) ]);
|
||
|
|
}, 500);
|
||
|
|
});
|
||
|
|
};
|