Код: Выделить всё
const prompt = require("readline-sync");
let countdown;
function timer(questionAnswer){
clearTimeout(countdown);
countdown = setTimeout(() => {
console.log("Sorry! you ran out of time. The answer was " + questionAnswer);
}, 5000);//
Подробнее здесь: [url]https://stackoverflow.com/questions/79772565/is-there-a-way-to-have-the-timer-override-the-prompt-input[/url]
Мобильная версия