mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 18:58:56 +00:00
Base: Use requestAnimationFrame in Game of Life WASM demo
Since OOPWV now supports RAF, we can use it in the GOL WASM demo :^)
This commit is contained in:
parent
d4a0ecac31
commit
ca060d8566
Notes:
sideshowbarker
2024-07-18 02:57:02 +09:00
Author: https://github.com/Lubrsi
Commit: ca060d8566
Pull-request: https://github.com/SerenityOS/serenity/pull/10391
1 changed files with 2 additions and 4 deletions
|
@ -1560,14 +1560,12 @@
|
||||||
time = performance.now() - start;
|
time = performance.now() - start;
|
||||||
celltime.innerText = time;
|
celltime.innerText = time;
|
||||||
|
|
||||||
// FIXME: Use RAF when OOPWV supports it.
|
requestAnimationFrame(renderLoop);
|
||||||
// requestAnimationFrame(renderLoop);
|
|
||||||
setTimeout(renderLoop, 16);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
drawGrid();
|
drawGrid();
|
||||||
drawCells();
|
drawCells();
|
||||||
setTimeout(renderLoop, 16);
|
requestAnimationFrame(renderLoop);
|
||||||
})
|
})
|
||||||
.catch(err => console.log(err.message, err));
|
.catch(err => console.log(err.message, err));
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue