How to show live timer in studio in Label Widget
Dear Community,
I want to show the timer in the studio in label widget but it does not get update as you can see my function also below. any idea how to achieve this functionality? when i run some other function then it gets render otherwise not.
Thank you
function startCountdown() {
var countDownTime = 95 * 60 * 1000;
var x = setInterval(function() {
// Decrease the time left by 1 second (1000 milliseconds)
countDownTime -= 1000;
// Time calculations for minutes and seconds
var minutes = Math.floor(countDownTime / (1000 * 60));
var seconds = Math.floor((countDownTime % (1000 * 60)) / 1000);
// Update the text in the widget
$scope.view.wdg["overAllTime"].text = minutes + "m " + seconds + "s ";
// If the countdown is over
if (countDownTime < 0) {
clearInterval(x);
$scope.view.wdg["overAllTime"].text = "TIME UP";
// Start the countdown again
startCountdown();
}
}, 1000);
}
// Start the countdown when the script runs
startCountdown();

