diff options
author | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2024-02-17 21:46:25 +0100 |
---|---|---|
committer | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2024-02-17 21:46:46 +0100 |
commit | 08e2cef4ff94ef358acf78cee92153d02f9e28fb (patch) | |
tree | 4e2083e1ab0a2dc64d8bbbc109820dc20e4957cb | |
parent | 574882d3135e8e9f8b15e252b0b8c2e5d767ae0c (diff) |
playSound: use performance.now
-rw-r--r-- | game.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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(); |