Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
14
Task/Sleep/JavaScript/sleep-2.js
Normal file
14
Task/Sleep/JavaScript/sleep-2.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
function worker() {
|
||||
const buf = new Int32Array(new WebAssembly.Memory({ initial: 1, maximum: 1, shared: true }).buffer)
|
||||
function sleep(ms) {
|
||||
Atomics.wait(buf, 0, 0, ms)
|
||||
}
|
||||
|
||||
for (let i = 10; i > 0; --i) {
|
||||
console.log(i)
|
||||
sleep(1000)
|
||||
}
|
||||
console.log('Blast off!')
|
||||
}
|
||||
|
||||
new Worker(URL.createObjectURL(new Blob([`(${worker})()`])))
|
||||
Loading…
Add table
Add a link
Reference in a new issue