Skip to main content
Participant
April 19, 2022
Question

Countup timer to go above 60 mins

  • April 19, 2022
  • 1 reply
  • 153 views

Hi there, so I want to create a countup timer which goes beyond 60 minuites and not into another digit for an hour. I want to timer to up to 90mins as I want it for a football edit i'm working on. I have used a YouTube video to get code for a timer but this code doesn't go beyond 60 mins. Currently when it ticks past 59:59 it resets back to 0 and starts counting again. If anyone could let me know what to change or add that would be hugely appreciated. 

Here is the code:

countspeed = 1;
clockStart = 0;

function times(n){
if (n < 10) return "0" + n else return "" + n
}

clockTime = clockStart +countspeed*(time - inPoint);

if (clockTime < 0){
minus = "-";
clockTime = -clockTime;
}else{
minus = "";
}

t = Math.floor(clockTime);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms = clockTime.toFixed(3).substr(-3);
minus + times(min) + ":" + times(sec)

 

 

This topic has been closed for replies.

1 reply

Mylenium
Legend
April 19, 2022

Simply replace the 3600 with a higher number. 90 minutes would be 5400.

 

Mylenium