MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / startTimer

Function startTimer

assets/js/Typingscript.js:87–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85}
86let startTime
87function startTimer(){
88 timerElement.innerText = 0
89 startTime = new Date()
90 setInterval(() => {
91 timerElement.innerText = getTimerTime()
92 myTime = getTimerTime()
93 }, 1000);
94}
95
96function getTimerTime(){
97 return Math.floor((new Date() - startTime) / 1000)

Callers 1

renderNewQuoteFunction · 0.70

Calls 1

getTimerTimeFunction · 0.85

Tested by

no test coverage detected