From 08e2cef4ff94ef358acf78cee92153d02f9e28fb Mon Sep 17 00:00:00 2001 From: Lieuwe Rooijakkers Date: Sat, 17 Feb 2024 21:46:25 +0100 Subject: playSound: use performance.now --- game.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game.js b/game.js index ee9da93..e34f4c2 100644 --- a/game.js +++ b/game.js @@ -303,7 +303,7 @@ function preloadSounds() { var lastSoundStampMap = {}; function playSound(name) { - var now = new Date(); + var now = performance.now(); console.log("playSound(\"" + name + "\")"); if (lastSoundStampMap[name] == null || now - lastSoundStampMap[name] >= 500) { soundMap[name].play(); -- cgit v1.2.3-54-g00ecf