From ca060d8566948f2dfbcd965fad053cebc17122f2 Mon Sep 17 00:00:00 2001 From: Luke Wilde Date: Thu, 7 Oct 2021 17:58:06 +0100 Subject: [PATCH] Base: Use requestAnimationFrame in Game of Life WASM demo Since OOPWV now supports RAF, we can use it in the GOL WASM demo :^) --- Base/res/html/misc/gol-wasm.html | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Base/res/html/misc/gol-wasm.html b/Base/res/html/misc/gol-wasm.html index b3e67c556c..51b5d15a15 100644 --- a/Base/res/html/misc/gol-wasm.html +++ b/Base/res/html/misc/gol-wasm.html @@ -1560,14 +1560,12 @@ time = performance.now() - start; celltime.innerText = time; - // FIXME: Use RAF when OOPWV supports it. - // requestAnimationFrame(renderLoop); - setTimeout(renderLoop, 16); + requestAnimationFrame(renderLoop); }; drawGrid(); drawCells(); - setTimeout(renderLoop, 16); + requestAnimationFrame(renderLoop); }) .catch(err => console.log(err.message, err));