switching time format from centieme de seconde to seconds

This commit is contained in:
Antoine M 2024-07-15 16:02:18 +02:00
parent 7984ae43a1
commit 45e7b1d584
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ export default function Timer() {
useEffect(() => { useEffect(() => {
if (!hasCheckedTutorial || !isTimeRuning) return; if (!hasCheckedTutorial || !isTimeRuning) return;
let intervalId; let intervalId;
intervalId = setInterval(() => setGameTime(gameTime + 100), 1000); intervalId = setInterval(() => setGameTime(gameTime + 1), 1000);
// setCurrentTime(currentTime); // setCurrentTime(currentTime);
return () => clearInterval(intervalId); return () => clearInterval(intervalId);

View File

@ -5,12 +5,12 @@ function calculateScore(answers) {
} }
function formatCurrentTime(currentTime) { function formatCurrentTime(currentTime) {
// Minutes calculation // Minutes calculation
const minutes = Math.floor((currentTime % 360000) / 6000) const minutes = Math.floor(currentTime / 60)
.toString() .toString()
.padStart(2, "0"); .padStart(2, "0");
// Seconds calculation // Seconds calculation
const seconds = Math.floor((currentTime % 6000) / 100) const seconds = Math.floor(currentTime % 60)
.toString() .toString()
.padStart(2, "0"); .padStart(2, "0");