For All those of you that need a Countdown Timer Function:
function timer() {
var epoch = Math.round(new Date().getTime() / 1000.0);
var countDown = 1200 - (epoch % 1200);
let minutes = (countDown / 60) | 0;
let seconds = (countDown % 60) | 0;
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
if (epoch % 1200 === 0) updateOtp(); // place any other function here
$w('#textUpdatingIn2').text = minutes + ":" + seconds;
$w('#updatingIn2').text = minutes + ":" + seconds;
}
This is a very basic Timer and where it says “updateOtp” you can place any function you would like here to take place once your timer has counted down to 0. This timer is set to 1200ms (2 Minutes) but can easily be adjusted. The Countdown is show in a text element here “textUpdatingIn2” and “updatingIn2” I hope this will help someone if it does let me know.