mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
14 lines
288 B
JavaScript
14 lines
288 B
JavaScript
const worker = new Worker(new URL("./worker.js", import.meta.url), {
|
|
type: "module",
|
|
});
|
|
|
|
const sab = new SharedArrayBuffer(1);
|
|
console.log(new Uint8Array(sab));
|
|
|
|
setInterval(() => {
|
|
console.log(new Uint8Array(sab));
|
|
}, 100);
|
|
|
|
worker.onmessage = () => {
|
|
worker.postMessage(sab);
|
|
};
|