Last active
June 8, 2023 01:45
-
-
Save itsMapleLeaf/c20b59b100ad9b5f5525cd897de79743 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function loop() { | |
let currentTime = performance.now() | |
while (true) { | |
const nextTime = await animationFrame() | |
const delta = nextTime - currentTime | |
// progress += delta | |
currentTime = nextTime | |
} | |
} | |
const animationFrame = () => new Promise((resolve) => requestAnimationFrame(resolve)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment