const display = document.getElementById(“display”);
let timer = null;
let startTime = 0;
let elapsedTime = 0;
let isRunning = false;
function start(){
if(isRunning){
startTime = Date.now()
}
console.log(startTime);
}
I already have a css and Html file linking to this start function and the rest of the code is incomplete but this Date.now() should be giving me a value and its not. having a feeling its VS code thats causing my issue, because on the console Date.now() works perfectly
I am trying to make a stop watch and Date.now() should be giving me a value but its returing 0your text
Ufuoms is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1