In my function to display the captcha, the captcha countdown is based on the current date. But when the system's date is set to future, multiple captchas get generated per second. How can I rephrase my function in a way that the captcha countdown is not based on the current date?
function captchaCountdown(timestamp) {
let secondsRemaining = timestamp - Math.floor(Date.now() / 1000);
if (secondsRemaining <= 1) {
// captcha expired
displayCaptcha();
}
}
I want to change the captchas every 60 seconds.