switching time format from centieme de seconde to seconds
This commit is contained in:
parent
7984ae43a1
commit
45e7b1d584
|
|
@ -11,7 +11,7 @@ export default function Timer() {
|
|||
useEffect(() => {
|
||||
if (!hasCheckedTutorial || !isTimeRuning) return;
|
||||
let intervalId;
|
||||
intervalId = setInterval(() => setGameTime(gameTime + 100), 1000);
|
||||
intervalId = setInterval(() => setGameTime(gameTime + 1), 1000);
|
||||
// setCurrentTime(currentTime);
|
||||
|
||||
return () => clearInterval(intervalId);
|
||||
|
|
|
|||
|
|
@ -5,16 +5,16 @@ function calculateScore(answers) {
|
|||
}
|
||||
function formatCurrentTime(currentTime) {
|
||||
// Minutes calculation
|
||||
const minutes = Math.floor((currentTime % 360000) / 6000)
|
||||
const minutes = Math.floor(currentTime / 60)
|
||||
.toString()
|
||||
.padStart(2, "0");
|
||||
|
||||
// Seconds calculation
|
||||
const seconds = Math.floor((currentTime % 6000) / 100)
|
||||
const seconds = Math.floor(currentTime % 60)
|
||||
.toString()
|
||||
.padStart(2, "0");
|
||||
|
||||
return `${minutes} : ${seconds}`;
|
||||
}
|
||||
|
||||
export { calculateScore, formatCurrentTime };
|
||||
export { calculateScore, formatCurrentTime };
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user