Data update

This commit is contained in:
Ingy döt Net 2025-06-11 20:16:52 -04:00
parent 72eb4943cb
commit 4d5544505c
2347 changed files with 62432 additions and 16731 deletions

View file

@ -0,0 +1,11 @@
function delay (ms) {
return new Promise((res) => setTimeout(res, ms))
}
void (async () => {
for (let i = 10; i > 0; --i) {
console.log(i)
await delay(1000)
}
console.log('Blast off!')
})()

View 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})()`])))

View file

@ -0,0 +1,8 @@
function sleepFuriously(ms) {
const start = Date.now()
while (Date.now() - start < ms);
}
console.log('sleeping...')
sleepFuriously(1000)
console.log('wow, that was exhausting!')

View file

@ -1,9 +0,0 @@
<script>
setTimeout(function () {
document.write('Awake!')
}, prompt("Number of milliseconds to sleep"));
document.write('Sleeping... ');
</script>