I need to make a timer in Javascript. I would like the timer to be reset at the beginning of the function, and called at the end.
'GetNewWordIntent': function () {
var wordInput = this.event.request.intent.slots.customWord.value;
if(wordInput == null || wordInput === "undefined" || wordInput == ''|| wordinput = "i dont know " ||wordinput = "I give up "){ //Alexa doesnt understand the word, so User loses.
this.emit('Unhandled'); //send to unhandled handler
}
else{
// Create speech output
getNextWord(wordInput, (speechOutput) => {
if(speechOutput == ''){
this.emit('Unhandled');
}
else{
//this.emit(':tellWithCard', speechOutput, this.t("SKILL_NAME"), speechOutput);
this.emit(':ask', speechOutput + '. <break time="1s"/> say another, Im Ready!'); // Start timer
}
});
}
},
I need to make a timer in Javascript. I would like the timer to be reset at the beginning of the function, and called at the end.
Thanks for the help!